Jump to content
Larry Ullman's Book Forums

Commands Out Of Sync; You Can'T Run This Command Now


Recommended Posts

Hello

 

I get this error when i try to run 2 prepared statement.. the 2 statements do not relate to each other.

The first one runs but the second doesn't... I deleted the first prepared statement and the second one worked find.

 

 

here is the error

Commands out of sync; you can't run this command now

 

 

Bahaa,

Link to comment
Share on other sites

I was able to figure out the problem

here is why it happens in case some of you run into this problem

 

This can happen, for example, if you are using mysql_use_result() and try to execute a new query before you have called mysql_free_result(). It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between.

 

 

I had to use mysq_store_result between the 2 queries.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...