Search engine

Question by bkrue514:
Help with script. Getting error ” Cannot connect to MySQL server on ‘Mysqldb’ (111). Can you help?

I am trying to get this php script loaded. It is one for buying words.
For some reason when I add a word in the /admin then it states “Can’t connect to MySQL server on ‘mysqldb’ (111)”

I have no clue what that means. Another weird thing is that I changed the foote and header, and it is changed in the main site, but when I go to /admin then it all looks the way it did when I uploaded it. Is something messed up?

Here is what the db looks like

$dbuser = "user";
$dbpass = "password";
$dbname = "buymeaword";

$hostname = "localhost";
$adminu = "user";
$adminp = "password";
$adminu = "user";
$adminp = "password";
$notify_url = "http://www.midmichiganads.com/bmaw/admin"; //where ipn_res.php is
$notify_url2 = "http://www.midmichiganads.com/bmaw/admin"; //where ipn_res2.php is
$return_page = "http://www.midmichiganads.com/"; //the main site url

$my_paypal = "@yahoo.com"; //your primary paypal address
$my_error = "@yahoo.com"; //the email where notifications will be send to

$adsense_pub="pub-0999107265272012";
$affid="395"; //your affiliate ID to promote Purchase me a Word script - check the user's guide to see how you can get this affiliate ID

$money_currency = "USD"; // USD, GBP, JPY, CAD, EUR

mysql_connect(localhost,user,password);
mysql_select_db(buymeaword);

?>

Obviously my username and password are not user/password,but is there anything wrong with this? The bottom of the thing is:
“mysql_select_db(buymeaword)”
and my error is :
“Can’t connect to MySQL server on ‘mysqldb’ (111)”
they both have “mysqldb” in them. Not sure if this helps or not. If you do not know then do not worry about it. I am just trying to figure out how to add words.

the site is www.midmichiganads.com/bmaw


——————————————

Answer by Crehl
From my limited knowledge, of PHP, Try:

mysql_connect($hostname, $dbuser, $dbpass)
mysql_select_db($dbname)

Could well be wrong, have not used either PHP nor MYSQL for a couple of years.

——————————————
What do you think? Answer below!