update query in symfony

$con = Propel::getConnection();

// select from…

$c1 = new Criteria();

$c1->add(FacilitiesBookingsPeer::FAB_ID, $fabId);


// update set

$c2 = new Criteria();

$c2->add(FacilitiesBookingsPeer::FAB_SLOTS, $newSlot);

BasePeer::doUpdate($c1, $c2, $con);


here in the code given above $c1 stands for “where” criteria of query

while $c2 stands for the fields to be updated. also you can add other fields to be updated if you want.

the last line of the code block “BasePeer::doUpdate($c1, $c2, $con);” remains as it is.  while the others are according to your table in action. here we have “FacilitiesBookingsPeer::FAB_SLOTS ”  FacilitiesBookingsPeer is table and  FAB_SLOTS is the field name to be updated

10 thoughts on “update query in symfony

  1. Hey!
    Give me any url for downloading XRUMER 5.0 Palladium warez!
    Thank you…
    Very-very much.
    I’m so need this program for promote my web projects! This software is the best thing for online promo and mass posting, you know…

    And, dont send me XRumer 2.9 and XRumer 3.0 – that versions are too old!

    P.S. Google cant help me((((

    • ya of course the web industry has been affected by crisis to a great extend. The web development companies that used to give a very good amount of appraisals are enable to make the salary of their employees at right time in this crisis. But without a doubt web industry is not going down. It is growing and in future will grow a lot.

    • actually i was in need of the same thing. and as it was for the first time to me, so i wrote a post so i can refer it for future use

  2. Thanks on your marvelous posting! I definitely enjoyed reading it, you are a great author.I will ensure that I bookmark your blog and definitely will come back in the foreseeable future. I want to encourage yourself to continue your great posts, have a nice weekend!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s