Welcome Guest, Not a member yet? Register   Sign In
how to concat query conditions using if statements
#2

[eluser]mddd[/eluser]
Code:
$this->db->where('price', 50);
$this->db->where('type', 5);

if ($checked1==1)
{
   $cats = array();
   if ($checked2==2)
   {
      $cats[]=5;
      if ($checked3==3) $cats[]=10;
      $this->db->where_in('cat', $cats);
   }
}

$this->db->get('author');


Messages In This Thread
how to concat query conditions using if statements - by El Forum - 04-26-2010, 09:35 PM
how to concat query conditions using if statements - by El Forum - 04-26-2010, 11:35 PM
how to concat query conditions using if statements - by El Forum - 05-05-2010, 01:45 AM
how to concat query conditions using if statements - by El Forum - 05-05-2010, 01:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB