Welcome Guest, Not a member yet? Register   Sign In
Passing array in a where clause?
#8

[eluser]datguru[/eluser]
Sorry for double post wasnt sure if it actually made the topic re appear in bold.

Im trying to now output the step that the institution is on now there are lots of steps but I only want to select the highest step and I only want one step per institution (the highest step). The problem i'm having with my current query is that it selects all top querys for each institution (so gives multiple steps for institutions which I dont want.)

Heres the query.
Code:
$data['instname'] = $this->db->where_in('institution_id',
$inst_id)->where('completed',1)->order_by('steps_id','desc')->limit(sizeof($inst_id))->join('institutions','institutions.id
= progress.institution_id')->get('progress');
Thanks again.


Messages In This Thread
Passing array in a where clause? - by El Forum - 05-09-2008, 02:49 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:05 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:08 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:20 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:24 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:27 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 03:28 AM
Passing array in a where clause? - by El Forum - 05-09-2008, 06:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB