I have to update multiple columns in Symfony, but I can nowhere find the solution... So, I'd like to do it in this way:
$q = Doctrine_Query::create()
->update('WebusersTable q')
->set('q.login_name','?','John')
->where('q.webuser_id=?',1)
->execute();
OK, that works, but I have to do it with several columns. I tried something like this, but it doesn't work:
$q = Doctrine_Query::create()
->update('WebusersTable q')
->set('q.login_name,q.name','?','kaka,pisa')
->where('q.webuser_id=?',1)
->execute();
Try:
$q = Doctrine_Query::create()
->update('WebusersTable q')
->set('q.login_name', 'John')
->set('q.name', 'Another value')
->where('q.webuser_id=?',1)
->execute();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With