$con = sfContext::getInstance()->getDatabaseConnection(‘propel’);
$c2 = new Criteria();
$c2->add(TblTopPeer::TF_ZIPCODE,$topForecastInfo->getForZipcode());
$c2->add(TblTopPeer::TF_FORCASTDATE,$topForecastInfo->getForForecastdate());

$c3 = new Criteria();
$c3->add(TblTopPeer::TF_FID,$topForecastInfo->getForId());
$c3->add(TblTopPeer::TF_USERID,$topForecastInfo->getForUserid());
$c3->add(TblTopPeer::TF_LATITUDE,$zipInfo->getZipLatitude());
$c3->add(TblTopPeer::TF_LONGITUDE,$zipInfo->getZipLongitude());
BasePeer::doUpdate($c2, $c3, $con);

OR

$con = Propel::getConnection();

// select from...
$c1 = new Criteria();
$c1->add(CommentPeer::POST_ID, $post_id);

// update set
$c2 = new Criteria();
$c2->add(CommentPeer::RATING, 5);

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.