Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How can I fix "General error: 2014 Cannot execute queries while other unbuffered queries are active."?

Hello, I was using raw sql queries without any problems when this error appear. I was querying for a resulset from a table and then a count from all the records and this error appears. How can fix this?

Thanks.

I'm not a Phalcon expert, but this sounds a lot like a general problem that can occur when you are using PDO that I've run into when using other frameworks. Basically, it happens when you send one raw PDO statement and then another without resetting the cursor in between.

You need to call ::closeCursor() on your PDOStatement object in between queries.

See: http://stackoverflow.com/questions/2066714/pdo-cannot-execute-queries-while-other-unbuffered-queries-are-active



11.8k
Accepted
answer

Apparently I just wrote a bad SQL sentence... touching here and there I solved the error.... Thanks XyploatKyrt.