Zend framework query, add to string

jurekowic

New Member
let's say that I have:\[code\]$query = $this->select() ->where('name LIKE ?','%something%'); ->where('section LIKE ?','%something%'); ->where('cars LIKE ?','%something%'); ............ ............\[/code\]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:\[code\]$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;\[/code\]Of course, this thing doesn't work but I guess you have understood what I want to make!Best Regards,
 
Back
Top