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

 Share

×
×
  • Create New...