简体   繁体   English

zend查询的where子句有什么问题

[英]What is wrong with this where clause of zend query

Hi I am mad on not understanding the error in this where clause of zend query. 嗨,我很生气,无法理解zend查询的where子句中的错误。 My query is 我的查询是

$select->where("id=".$get['value']." OR description like '%".$get['value']."%'");

$get['value'] is the query that I want to search. $get['value']是我要搜索的查询。 But result is 500 internal server error and it always says the value of get['value'] is unkown column. 但是结果是500 internal server error ,并且总是说get['value']是未知列。 For example if I have searched testing for description column it always says that testing in unknown columns... why is this happening 例如,如果我搜索了description列的testing ,它总是说在未知列中testing ...为什么会这样

Check this docs zend_db_select you may wrong in your syntax. 检查此文档zend_db_select您的语法可能不正确。

$table->select()
         ->where('id = ?', $get['value'])
         ->orWhere('description like ?', '%' . $get['value'] . '%');

Edited! 编辑!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM