Running this peace of code
$id = $_GET['id']; // get current menu order $sql = "SELECT menuOrder FROM categories WHERE id = $id "; $cmd = app()->db->createCommand($sql); /*@var $cmd CDBCommand */ //$cmd->bindValue('id',$id); $menuOrder = $cmd->queryScalar(); $oldMenuOrder = $menuOrder + 1; // get id of next $sql1 = "UPDATE categories SET menuOrder = menuOrder -1 WHERE menuOrder = $menuOrder +1 "; app()->db->createCommand($sql)->execute(); $sql2 = "UPDATE categories SET menuOrder = $oldMenuOrder WHERE id = $id"; app()->db->createCommand($sql)->execute();
I gets an error:
Platform Winxp, php 5.3.0, MySql 5.1.39-community, i gets this error while running few queries to database in a row, it doesn't happen if close connection after each query, and then create the new database connection. But i recieved this error on earlier PHP versions, and MySql...
Anyone had this issue ? While running my code on hosting i don't get any issues doing few SELECT, UPDATE, TRUNCATE statements in a row. While under WINXP it ruins by "executing unbuffered queries". They advise to use PDO::MYSQL_ATTR_USE_BUFFERED_QUERY constant. Where to put this in a case of Yii config ?