Question : PHP cannot connect to mySQL on LAMP server

I just setup a new Fedora 8 server on Amazon AWS and PHP cannot connect to mySQL.  PHP gives me an error like this whenever I try to use it:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource...

I can connect to the server and run the query fine using MySQL Admin from my Windows PC.  I am using the same username and password.
But if there was a config permission problem it seems like the error would occur in the mysql_connect statement.  Instead it occurs in the
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
$dbhost = 'localhost';
$dbuser = 'jlmsguy';
$dbpass = 'wildcat10!';
$dbname = 'jlms';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);

$sql = "SELECT ID FROM sampletable where ID > 1";
$rs = mysql_query($sql, $conn);
$row = mysql_fetch_assoc($rs);

Answer : PHP cannot connect to mySQL on LAMP server

I've tested the menu in IE7 & IE8, the menu works fine but I noticed 2 minor issues, and the client's experience might have something to do with the first one.
  • From your homepage, if you click "Special Diets" it will take you to the page (/menu/MKMeals.html) wish the list of MKMeals.

    While all the other pages seems to have an invalid link for the "Special Diets" link, clicking it doesn't go anywhere and its href="#url".
     
Althought it doesn't break the menu on my IE8, the invalid URL might be causing some issues with the Client's browser, you can ask to click the link from the homepage and check if they would encounter the same problem.
  • On the page senior-food-gifts.html, the image preload is throwing a JavaScript Error (MM_preloadImages is not defined), in some cases a JavaScript error could disable other JavaScripts from running, so I'd check all pages and correct any similar JS errors

Hope this helps

Random Solutions  
 
programming4us programming4us