开发者

What is wrong with this where clause of zend query

开发者 https://www.devze.com 2023-02-23 22:52 出处:网络
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\'].\"%\'\");

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


Check this docs zend_db_select you may wrong in your syntax.

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

Edited!

0

精彩评论

暂无评论...
验证码 换一张
取 消