我有了在其名称中的空格的列的数据库表: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