0
過去2天裏一直試圖安裝此模塊。其彈出錯誤YII用戶管理模塊安裝錯誤 - 一般錯誤:2014
CDbCommand failed to execute the SQL statement: 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.. The SQL statement executed was: CREATE TABLE IF NOT EXISTS `user_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NOT NULL,
`participants` text NULL,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
在文件的代碼的這些行:\保護\模塊\用戶\控制器\ YumInstallController.php(134):CDbCommand->執行()
if (isset($_POST['installUsergroup'])) {
$sql = "CREATE TABLE IF NOT EXISTS `" . $usergroupTable . "` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NOT NULL,
`participants` text NULL,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$db->createCommand($sql)->execute(); //throws exception on this line.
$createdTables['usergroup']['usergroupTable'] = $usergroupTable;
我試圖在運行查詢之前使用代碼行
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
。 環顧四周,但解決方案告訴我不適合我。我在這裏錯過了什麼?這裏的任何幫助將不勝感激。
這裏註明爲工作解決類似的問題:http://stackoverflow.com /問題/ 6857378 /警予創建,臨時表和使用,其功能於下查詢產生,一般錯誤 – schmunk