⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Where In clause in grocery crud



abhishek
  • profile picture
  • Member

Posted 03 May 2013 - 13:25 PM

I want to add multiple values in where clause.

 

------------As In Sql , we do like this------------------

SELECT column_name(s)

FROM table_name

WHERE column_name IN (value1,value2,...)

------------------------------------------------------------

How to use this in grocery crud..??


victor
  • profile picture
  • Member

Posted 03 May 2013 - 13:34 PM

you have the same fields in both tables.
you can type like this:
tablename.column, tablename.column2
or you can rename fields

davidoster
  • profile picture
  • Member

Posted 03 May 2013 - 14:22 PM

You can have multiple where

http://www.grocerycrud.com/documentation/options_functions/where

 

$crud->where('status','active');

$crud->where('name !=', $name);

$crud->where('job =', $job);

 

or you can do this

 

$where = "name='Joe' AND status='boss' OR status='active'";
$crud->where($where);


victor
  • profile picture
  • Member

Posted 03 May 2013 - 14:28 PM

sorry I did not read the question carefully

kenshicu
  • profile picture
  • Member

Posted 19 June 2013 - 19:57 PM

see  /topic/1797-taking-where-in-function-in-codeigniter-to-gc/