how to implement concatenate mysql queries in zend framework Model -


hi new in zend framework.

i want know possible use concatinate queries in zend model. example in core php

$abc ="select * emp" if ($_post ['a'] != '')     {     $abc =$abc ." code=$_post ['a']";    }     if ($_post ['b'] != '')  {     $abc =$abc ." name=$_post ['b']";  } $abc.=" order datetime;"; 

if possible want implement above code in zend model.

yes can such in zend. here dummy idea you.

first create object of model of emp table.

$emp = new application_model_emp();  $select = $emp->select(); 

in model $_post not working need pass arguments controller. here using variable.

if($a != '') {   $select->where("code = ?", $a); }  if($b != '') {   $select->where("name = ?", $b); }  $select->order("datetime");  $rows = $emp->fetchall($select); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -