Welcome Guest, Not a member yet? Register   Sign In
$this->db->where_in
#4

[eluser]barbazul[/eluser]
I don't see how are you connecting the where_in call with the rest of the query.

When calling query() with two parameters, you are executing that query regardless of any previously set conditions in the active record.
That means the call to where_in is completely ignored.

You either build your own queries or you let AR build them for you... bt you can't have a bit of both.

Try this:
Code:
$this->db->select('DealerLogNumber');
$this->db->from('tblDealerInfo');
$this->db->where('`DealerCode` = (SELECT `UserDealerCode` FROM `fa_user_profile` WHERE id = '. $this->db_session->userdata('id').')');
$this->db->where_in('VehServicingDealer',array(5,6));
$VDFUquery = $this->db->get();

        
foreach ($VDFUquery->result_array() as $row)
{
   echo $row['DealerLogNumber'];
}


Messages In This Thread
$this->db->where_in - by El Forum - 11-09-2008, 12:32 PM
$this->db->where_in - by El Forum - 11-09-2008, 12:43 PM
$this->db->where_in - by El Forum - 11-09-2008, 02:34 PM
$this->db->where_in - by El Forum - 11-09-2008, 07:25 PM
$this->db->where_in - by El Forum - 11-09-2008, 07:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB