I have a few triggers which are executed using PHP PDO . I am using Laravel framework .
I am using solydK OS with the latest Xampp installed. The triggers are giving the following errors:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.'
After some tweaking, i tried executing the queries with PDO::exec()
, and it worked!
So, the result is: it works with PDO::exec()
but fails with PDO::query
and PDO::prepare()
I want to know the reason behind this, does PDO::exec()
do something special or may be
Laravel has some special configuration.
Note1: I have already tried solutions described here & here
Note2: It works perfectly if simple PDO is used instead of Laravel DB wrapper .
Note3: PDO is using mysqlnd driver