testmysql.php error issues
Posted by: KennyGK (---.lightspeed.sntcca.sbcglobal.net)
Date: November 01, 2012 03:20AM

Steven,

Your answer to my last issue/post worked. Thanks! I already had my browser set to delete upon exit, but needed to set it to 'every time I visit the webpage'. Bingo!! ...but one more issue. Please read on. ...

I found WAMP via Lynda.com.
[www.lynda.com] Chapter3 Installing WAMP server

After the download I installed it and proceeded to the testing steps of 'Localhost', 'phpmyadmin', editing testmysql.php (see screenshot of modified file), and then entered [localhost]. However, when I hit enter I got an errorreport (see screenshot with orange backgrounds). However, that is not what I should get, but rather a 'connection ok' message.

All 5 Screenshots:
[sdrv.ms]
[sdrv.ms]
[sdrv.ms]
[sdrv.ms]
[sdrv.ms]

Do you know how to fix this problem?

Thanks so much Steven!

Options: ReplyQuote
Re: testmysql.php error issues
Posted by: RiggsFolly (---.as13285.net)
Date: November 01, 2012 05:16AM

Afraid your screen images didnt link properly so I cannot see them.

Assuming your wamp icon is green, I preume that you have edited the testmysql.php incorrectly.

If you have not changed the mysql 'root' user in any way i.e. added a password your code should look like this:

$link = mysql_connect('localhost','root','');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);



If you have added a password it should look like this:

$link = mysql_connect('localhost','root','YOURPASSWORD HERE');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);



If you have created a new mysql user and password it should look like this:

$link = mysql_connect('localhost','NEW_USER','NEW_PASSWORD');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);



Hope this covers most of the eventualities.

Options: ReplyQuote
Re: testmysql.php error issues
Posted by: stevenmartin99 (Moderator)
Date: November 01, 2012 06:30AM

Oh u posted it twice, as Riggs said, it's the host name

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.