我有了在其名稱中的空格的列的數據庫表:Audio book
秒。我想要select all rows where Audio books = 1
。我正在使用Zend Framework來執行此操作。我的功能看起來是這樣的:通過Zend Framework的選擇傳遞列名稱用空格()
public function fetchAudio()
{
$resultSet = $this->tableGateway->select(array('Audio books' => 1));
return $resultSet;
}
的目標是選擇所有行「有聲讀物」 = 1
該網站將返回該錯誤:
Statement could not be executed (42000 - 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 '
books
= 1' at line 1)
如何獲得本專欄使用該方法?
所以我有以下: 語句無法執行(42000 - 1064 - 你在你的SQL語法錯誤;檢查對應於你的MySQL服務器版本使用附近「'books''''' = 1」正確的語法手冊在第1行) 對不起,離開這個列名是很重要的。我正努力通過這個... – 742darek
你能澄清目標嗎?是不是'Audio books'應該是一個值爲1的靜態列?或者是一個過濾條件'WHERE Audio books = 1'? –
是的,正好是WHERE Audio books = 1 – 742darek