Doctrine_Query update with float value
Posted
by YS-PRO
on Stack Overflow
See other posts from Stack Overflow
or by YS-PRO
Published on 2010-04-19T09:02:15Z
Indexed on
2010/04/19
9:13 UTC
Read the original article
Hit count: 290
I need to increment User's balance, so I do:
Doctrine_Query::create()->from('User')->update('balance', 'balance + 0.15')->execute();
And I got an error "Unknown component alias 0". I think its because of 0.15
So how can I update (using DQL) balance without additional SELECT queries to User's table to fetch his balance, calculate new balance and do query like Doctrine_Query::create()->from('User')->update('balance', '?', $new_balance)->execute();
© Stack Overflow or respective owner