2013-05-03 3 views
0

where 절에 여러 값을 추가하고 싶습니다. SQL에서 같이식료품 crud에서 where 절에 여러 값을 추가하십시오.

------------, 우리는이 ------------------

SELECT column_name(s) 
FROM table_name 
WHERE column_name IN (value1,value2,...) 

좋아해요

식료품 점에서 이것을 사용하는 방법? 이 당신을 도와

$this->db->where_in('columnname', $arrayvalues); 

희망, 더 질문을 주저하지 않습니다 =)

GroceryCrud Documentaion WHERE

답변

2

where 대신 or_where입니다.

예컨대

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

0

사용 : GroceryCrud에 절은 정확히 CodeIgniter의의 WHERE 절처럼 작동