Jump to content

Help with academic project


CreaDigi

Recommended Posts

Hi,I am trying to access a database using the a html 5 select field for a mobile app for college. I have been trying to use the w3schools tutorial found here:http://www.w3schools.com/php/php_ajax_database.aspI have essentially copied the tutorial exactly but I keep getting the error:Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\ajax\getuser.php on line 25I cant actually reproduce the tutorial without errors which is very frustrating as I need to be able to get this to work within a html 5 phonegap app. Any help would be greatly appreciated.Many thanks

Link to comment
Share on other sites

$result is returning false. it returns false when mysql_query() fails. you have to check why it is failing

 $result = mysql_query($sql); if(!$result)echo mysql_error();

what does it print? reference: http://php.net./mysql_error http;//php.net/mysql_query

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...