Creative, Informative and Entertaining Stuff for everyone

Monday February 6th 2012

Categories

Archives

Calender

February 2012
S M T W T F S
« Dec    
 1234
567891011
12131415161718
19202122232425
26272829  

update query in symphony (Method 2)

Bookmark and Share

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

Reader Feedback

One Response to “update query in symphony (Method 2)”

  1. Renjith says:

    How this criteria works with more than one ‘where’ conditions like this?
    WHERE column1 =’1′ and column2 =’1′

Leave a Reply