T
TonnyD
I have been trying to install a PHP built poll with mysql and have
been having no luck. I am experimenting with a poll called chipmunk
poll. The problem im having right now is connecting it to the mysql
database. I am using godaddy.com with the 4.1 version. This is the
script on the connect php file;
<?PHP
$db = mysql_connect("localhost", "username", "password") or die("Could
not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("db_name",$db))
die("No database selected.");
if(!get_magic_quotes_gpc())
{
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
?>
I replace the text, username, password, and db_name with the proper
information. I have never had success with localhost so I replaced it
with the hostname, "h41mysql59.secureserver.net" I was thinking that
maybe I need to change some permission or something in the database.
The end result i get is a page saying "could not connect." I was able
to install vbulletin in the past just fine so im not sure what the
problem is here. Iv had this same problem with every php poll I try to
install. What do you guys think?
been having no luck. I am experimenting with a poll called chipmunk
poll. The problem im having right now is connecting it to the mysql
database. I am using godaddy.com with the 4.1 version. This is the
script on the connect php file;
<?PHP
$db = mysql_connect("localhost", "username", "password") or die("Could
not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("db_name",$db))
die("No database selected.");
if(!get_magic_quotes_gpc())
{
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
?>
I replace the text, username, password, and db_name with the proper
information. I have never had success with localhost so I replaced it
with the hostname, "h41mysql59.secureserver.net" I was thinking that
maybe I need to change some permission or something in the database.
The end result i get is a page saying "could not connect." I was able
to install vbulletin in the past just fine so im not sure what the
problem is here. Iv had this same problem with every php poll I try to
install. What do you guys think?