What is wrong with this where clause of zend query

依然范特西╮ 提交于 2019-12-11 15:03:46

问题


Hi I am mad on not understanding the error in this where clause of zend query. My query is

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

$get['value'] is the query that I want to search. But result is 500 internal server error and it always says the value of get['value'] is unkown column. For example if I have searched testing for description column it always says that testing in unknown columns... why is this happening


回答1:


Check this docs zend_db_select you may wrong in your syntax.

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

Edited!



来源:https://stackoverflow.com/questions/5620249/what-is-wrong-with-this-where-clause-of-zend-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!