unbuffered-queries

I get 2014 Cannot execute queries while other unbuffered queries are active when doing exec with PDO

梦想与她 提交于 2019-12-25 04:38:32
问题 I am doing a PDO::exec command on multiple updates: $MyPdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true); $MyPdo->exec("update t1 set f1=1;update t2 set f1=2"); I am doing it inside a transaction, and I keep getting the following error: 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

unbuffered query with MySQLi?

拜拜、爱过 提交于 2019-12-19 13:49:06
问题 Are MySQLi queries unbuffered? If not, is there a way to do an unbuffered query, as with the non-MySQLi mysql_unbuffered_query() ? 回答1: mysqli_real_query() followed by mysqli_use_result() 回答2: MindStalker is right but maybe the easiest way is the one shown in the PHP manual http://php.net/manual/en/mysqlinfo.concepts.buffering.php Passing the MYSQLI_USE_RESULT constant as the resultmode argument, you can set mysqli_query to work as mysql_unbuffered_query <?php $mysqli = new mysqli("localhost"

MySQL “Fire-And-Forget” INSERT / UPDATE / DELETE - mysql_unbuffered_query usage advisable?

左心房为你撑大大i 提交于 2019-12-10 20:38:17
问题 We have quite a few queries we consider "fire and forget". In the sense that these are just logging inserts, updates and such. Things that are not as critical, and data from which is never used on the front end the users sees. This sounds like an ideal case for mysql_unbuffered_query . Is this advisable? We are using innodb so using something like INSERT DELAYED is not possible. Thanks! 回答1: After reading http://www.php.net/manual/en/mysqlinfo.concepts.buffering.php: Following these

unbuffered query with MySQLi?

巧了我就是萌 提交于 2019-12-01 16:16:51
Are MySQLi queries unbuffered? If not, is there a way to do an unbuffered query, as with the non-MySQLi mysql_unbuffered_query() ? mysqli_real_query() followed by mysqli_use_result() MindStalker is right but maybe the easiest way is the one shown in the PHP manual http://php.net/manual/en/mysqlinfo.concepts.buffering.php Passing the MYSQLI_USE_RESULT constant as the resultmode argument, you can set mysqli_query to work as mysql_unbuffered_query <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); $uresult = $mysqli->query("SELECT Name FROM City", MYSQLI_USE_RESULT); if (