okay as an update. I fixed this line of code below and am now getting this message when accessing http://bobbyrahal.com/connect_test.php (ah_rsvp is the user)
[B]SANITY CHECK
Can’t use foo : Access denied for user ‘ah_rsvp’@‘%’ to database ‘foo’[/B]
This was the code I changed.
<?php
echo 'SANITY CHECK<hr />'; //changed the Quotation mark in "SANITY to 'SANITY
(//changed the Quotation mark in "SANITY to 'SANITY)
Access denied for user ‘ah_rsvp’@‘%’ to database ‘foo’
Well now you are getting to it, at least the error is making some sense now. The user (whose credentials are accepted) does not have access to the database “foo”, which of course does not exist, so what IS the name of the database then - because foo is just a pseudo name.
I think I understand everything from your previous post with the exception of the ‘foo’ variable… what do I put in place of ‘foo’?
(//changed the Quotation mark in "SANITY to 'SANITY)
I cant believe I wrote that …
if (!$db_selected) {
die ('Can\\'t use foo : ' . mysql_error());
}
phpinfo();
?>
Change the above to this now, get rid of the PHP info - I just wanted to make sure PHP was working too, and write a confirmation that you HAVE connected - like so…
// ... as before
if (!$db_selected) {
die ('Can\\'t use foo : ' . mysql_error());
}else{
echo 'We are connected to the database at last, and we have proved that PHP's Mysql_* extensions are working';
}
?>
Again, replace foo in that message with the name of your database if you wish.
So now either reintroduce parts of your original script line by line, hopefully echoing something onto the page actually proving that what you imagine should happening is happening, or just substitute the above connection code and hope for the best.
Don’t forget to remove you actual db credentials from that file and include() them from a directory which is not publicly accessible.