php - incremental update with symfony/propel -
I would like to execute a query in Symphony using an option ORM:
< Code> ADS set hits = hits + 1 where to update ID = 10;
I know that the Propellal API can set me a first set value for a given column of a given record, but I must first set the column value before issuing an update query Do not want to retrieve
Thank you.
itemprop = "text">
this ad is Symfony 1.3 / 1.4:
In AdsPeer is:
public static function incrementHits ($ id) {$ con = propel :: getConnection (AdsPeer :: Database_Name); $ Query = 'Update Hit SET Hit + 1WHERE id =' $ Id; SfContext :: getInstance () - & gt; GetLogger () - & gt; Crit ($ query); $ Stmt = $ con- & gt; Ready ($ query); $ $ = $ Stmt-> carry about (); }
To use:
AdsPeer :: incrementHits ($ id);
HH
Mike
Comments
Post a Comment