set_relation multiple where
- Single Page
Posted 10 May 2012 - 08:46 AM
is there a way to put multiple where(and/or) in set_relation?
Posted 11 May 2012 - 02:01 AM
[color=#2C575B][font=Arial, Tahoma, Helvetica, sans-serif]
You can also have a where clause at the 4th parameter (is not a required parameter). For example:[/font][/color][color=#2C575B][font=Arial, Tahoma, Helvetica, sans-serif]
[color=#0000FF]$crud[/color]->[color=#006600]set_relation[/color][color=#66CC66]([/color][color=#FF0000]'user_id'[/color],[color=#FF0000]'users'[/color],[color=#FF0000]'username'[/color],[color=#000066]array[/color][color=#66CC66]([/color][color=#FF0000]'status'[/color] => [color=#FF0000]'active'[/color][color=#66CC66])[/color][color=#66CC66])[/color]; [/font][/color]
Posted 12 May 2012 - 03:25 AM
where status ='active' or status ='done' etc..
int the 4th parameter i tried putting multiple value for the status but it only accept the last value of the array
my code is
[color=#2C575B][font=Arial, Tahoma, Helvetica, sans-serif][color=#66CC66]
[/color][/font][/color][color=#2C575B][font=Arial, Tahoma, Helvetica, sans-serif][color=#66CC66]'')[/color][color=#66CC66])[/color]; [/font][/color]
$crud->set_relation('user_id','users','username',array('status' => 'active','status'=>'prospect'));
I know that this must create a statement using both and will use and but it will only show rows with the status ='prospect' and also want to use or on the where statement. will show both status ='active' or status ='prospect'.