[Typo3-dev] exec_UPDATEquery question.

Karsten Dambekalns k.dambekalns at fishfarm.de
Wed Jul 7 19:46:04 CEST 2004


Hi,

On 2004-07-07, Stig N. Jepsen <stig at 8620.dk> wrote:
> I have a problem using exec_UPDATEquery with a specific update.
>
> In theory I want to do something like this:
> UPDATE persondata SET age=age+1;

Uh-oh.

> F.x. if I supply a dataset like this array("age"=>"age+1") I think it tries
> to put in the string age+1 instead of adding 1 to the value of age.
> Am I correct in this?

Yes. It quotes all values, so in the final query you get 'age+1' (in
single quotes), which is seen as a string by the DB. Bummer.

If there is really a need for this, we'd have to invent a way to
specify *not* to query a certain value, as it is intended to be used
as 'raw SQL'.

If anybody has suggestions on how this could be done in a nice and
friendly way for the developers (those who have to use the DBAL later,
I mean, not the ones coding it :)) - just shoot.

Karsten




More information about the TYPO3-dev mailing list