Hi guys, let's say that I have:
$query = $this->select()
->where('name LIKE ?','%something%');
->where('section LIKE ?','%something%');
->where('cars LIKE ?','%something%');
............
............
You get the point!
But I want to add the where() clause to the query only let's say if..$x = 0; something like this:
$select = $this->select();
if($x == 0):
//add to the $this->select(); so it will be $this->select()->where('section LIKE ?','%something%');
$select->where('section LIKE ?','%something%');
endif;
if($x == 0):
/*add to the $this->select(); so it will be
$this->select()->where('section LIKE ?','%something%')
->where('cars LIKE ?','%something%');
*/
$select->where('cars LIKE ?','%something%');
endif;
Of course, this thing doesn't work but I guess you have understood what I want to make!
Best Regards,