Blog Image

update query in symphony (Method 2)

For example to execute query like

UPDATE tableName SET column1 = 'abc',column2 = 'xyz' WHERE column ='1';

In symfony you can do it this way

$c = new Criteria();
$c->add(MyTablePeer::COLUMN,1);
$c->add(MyTablePeer::COLUMN1,'abc');
$c->add(MyTablePeer::COLUMN2,'xyz');
MyTablePeer::doUpdate($c);

Thanks



Author: admin

Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management. He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.