Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/246752-please-help-me/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/246752-please-help-me/#findComment-1267218
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/246752-please-help-me/#findComment-1267371
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.