[symfony-users] Re: Doctrine: Can't figure how to execute this: UPDATE user SET points = LEAST(200,300)

2010-09-30 Thread webdev_aw_ucsb
I'm new to symfony myself ... but I dont think that Doctrine understands the Mysql specific function LEAST() in this case. Eg this listing for SELECT/WHERE clauses doesn't list it: http://www.doctrine-project.org/documentation/manual/2_0/en/dql-doctrine-query-language#dqlfn You can always

[symfony-users] Re: Doctrine: Can't figure how to execute this: UPDATE user SET points = LEAST(200,300)

2010-09-29 Thread torok84
Workaround: $conn = Doctrine::getConnectionByTableName('User'); $conn-exec('UPDATE user SET points = LEAST(200,300)'); Any chance this can be done using Doctrine? Paolo On Sep 29, 2:56 pm, torok84 toro...@gmail.com wrote: [ In the real application I would have something like

[symfony-users] Re: Doctrine: Can't figure how to execute this: UPDATE user SET points = LEAST(200,300)

2010-09-29 Thread guiguiboy
Be careful, LEAST is not SQL standard, this means if you change you database server, you may (will) encounter problems. Why not doing it with PHP ? You have the min function : http://fr.php.net/min On 29 sep, 15:05, torok84 toro...@gmail.com wrote: Workaround: $conn =

[symfony-users] Re: Doctrine: Can't figure how to execute this: UPDATE user SET points = LEAST(200,300)

2010-09-29 Thread torok84
I suspected that, anyway I guess if the DB changes some other query will need to be rewritten. I choose not to use PHP because it would be tens of times slower. (Using PHP would mean to fetch all the records, create relative doctrine objects, modify them and save back...). Paolo On 29 Set,