0
我想在where子句中添加多个值。在grocery crud的where子句中添加多个值
------------在SQL,我们做这样的------------------
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...)
如何在食品杂货中使用它?
我想在where子句中添加多个值。在grocery crud的where子句中添加多个值
------------在SQL,我们做这样的------------------
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...)
如何在食品杂货中使用它?
的WHERE在GroceryCrud子句的工作方式完全一样笨的WHERE子句:
$this->db->where_in('columnname', $arrayvalues);
希望这可以帮助你,不要犹豫,继续提问=)
GroceryCrud文件建立WHERE
使用or_where
而不是where
。
e.g
function example_with_or_where() {
$crud = new grocery_CRUD();
$crud->where('productName','Motorcycle');
$crud->or_where('productName','Car');
$crud->or_where('productName','Bicycle');
$crud->set_table('products');
$crud->columns('productName','buyPrice');
$output = $crud->render();
$this->_example_output($output);
}
详细here