corneleus Posted September 9, 2011 Share Posted September 9, 2011 Hello everyone, I have recently tried an Ajax/PHP tutorial from http://www.w3schools.com/PHP/php_ajax_database.asp They have a working example of this code on the above url. I tried to mimic this code in my apache server to see if I could get it working. However I keep getting this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in etc. It's telling me that the error is in the php script around the while clause. However I can't see an immediate problem. Or perhaps i'm being blind. Please can anybody help me? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 9, 2011 Share Posted September 9, 2011 When a query execution is performed with mysql_query(), it returns a result resource on success, or a boolean FALSE on failure. mysql_error() should give you some insight as to why your query is failing. Quote Link to comment Share on other sites More sharing options...
corneleus Posted September 9, 2011 Author Share Posted September 9, 2011 Yeah, I was thinking that perhaps the query has failed somewhere, but I can't see anything that looks wrong in the code to tell. I've got a feeling that AJAX isn't sending any variables in the URL parameter to be parsed by PHP. But I'm pretty new to AJAX and was wondering if anyone can offer any insight into a more correct way to send url variables to php through an AJAX call. If anyone can help I'll be very greatful. Quote Link to comment Share on other sites More sharing options...
corneleus Posted September 9, 2011 Author Share Posted September 9, 2011 Fuck it, I've done it myself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.