Search code examples
phpmysqlzend-frameworkzend-db

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. 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


Solution

  • Check this docs zend_db_select you may wrong in your syntax.

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

    Edited!