我想知道在哪里写选择查询是用 cake php 写的我只在控制器中看到以下代码
function getpages($position = 'top') {
return $this->Page->find('all', array('conditions' => 'Page.'.$position.'_show > 0', 'order' => 'Page.'.$position.'_order ASC'));
}
及其给出以下错误
警告 (512) SQL 错误:1064:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在附近使用的正确语法
'FROM AS `Page` WHERE `Page`.`top_show` > 0 ORDER BY `Page`.`top_order` ASC'
和
$this->set('categories', $this->Category->find('all', array('conditions' => array('Category.parent_id' => $category['Category']['id']), 'order' => array('Category.name' => 'asc'))));
给出以下错误
SQL 错误:1064:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在 '' 附近使用的正确语法
请告诉我如何解决它