更改服務器配置後。更新MYSQL和PHP。我得到不同的SQL錯誤,像這樣的:PDO相關數據庫錯誤
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = '759'' at line 1
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.
我加入$this->dbo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
,的結果代碼中的錯誤。
我沒有改變任何代碼,所以它不能是synthax錯誤?
UPDATE: 功能loadAssoc($值= FALSE){
// Execute statement
($values) ? $this->statement->execute($values) : $this->statement->execute();
// Return associative array
return $this->statement->fetch(PDO::FETCH_ASSOC);
}
我得到的錯誤PHP的致命錯誤:調用一個成員函數的execute()在使用執行線。
在我的cPanel它說:LINUX,PHP 5.3.21和MySQL 5.5.28(剛剛升級到這個)認爲這將解決這個問題
就像我前面說的一切我的服務器更新之前工作:S
請顯示完整查詢的示例。 – silkfire 2013-02-21 20:49:21
嘗試使用PDO啓用緩衝查詢時顯示'代碼錯誤' – hek2mgl 2013-02-21 20:53:10
第一個錯誤與PDO無關 - * *您已經編寫了*語法錯誤*查詢。 – zerkms 2013-02-21 20:54:06