It may help

$obj = TablePeer::retrieveByPK($us_pk);               // retrieveByPK() is
at lib/model/om/BaseTablePeer.php
$obj->setStatus($status);                                            //it
will your field name
$obj->save();









On Sun, Feb 24, 2008 at 4:17 PM, Jagtesh Chadha <[EMAIL PROTECTED]> wrote:

>
> Hello everyone.
>
> I've been searching for 2 days to find a way of updating a field
> throughout a table, similar to the following raw SQL query:
>
> UPDATE table_name
> WHERE table_name.field1 = somevalue
> SET table_name.field2 = someothervalue;
>
> My guess is there should be some criteria method to allow adding a
> "SET table_name.field2 = ..." line to the query along with the
> doUpdate Peer method.
>
> I've tried the follow, which doesn't work for obvious reasons:
> $c = new Criteria();
> $c->add(TablePeer::FIELD1, somevalue);
> $c->add(TablePeer::FIELD2, someothervalue); // This is where I need
> help
>
> $res = TablePeer::doUpdate($c);
>
> I've looked all around for an exhaustive list of methods of the
> Criteria class, but without any success.
>
> Any help will be greatly appreciated :-)
> >
>


-- 
Birchandra Sanasam
Web Developer & Analyst
# +91 9810 191478

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to