Monday, 15 September 2014

mysql - symfony 1.4 and php switch case -



mysql - symfony 1.4 and php switch case -

in database, have column enum...column_name = enum('column1',column2','column3') , in action,

public function executeview_collection_details(sfwebrequest $r) { $collection = doctrine_core::gettable('collections')->findonebyid($r->getparameter('id')); $data = array(); $this->setlayout(false); switch($collection->mode_of_payment) { case 'column1': $obj = $collection->column1; $data = array( //..... ); break; case 'column2': $obj = $collection->column2; $data = array( //....... ); break; case 'column3': $obj = $collection->column3[0]; $data = array( //..... ); break; } $this->data = $data; }

i added column name term int(4).i dont want add together enum in mysql since user add together them manually in form,what mean value column added user.this column values represent number of days of payment(40,60,90...days)my question is, possible add together switch statement in action column(term)?i want display number of rows each value, e.g 40 days print table fixed 40 number of rows.and tried foreach statement failed.i tried googling examples around net found no one..

php mysql symfony1

No comments:

Post a Comment