Mailing List Archive



Back to the month index Back to the list index

Fernando Maior (fmaior@upol.com.br)
Thu, 22 Apr 1999 09:49:06 -0300


Message-ID: <371F1AC2.95E81C6@upol.com.br>
Date: Thu, 22 Apr 1999 09:49:06 -0300
From: Fernando Maior <fmaior@upol.com.br>
Subject: Re: syntax please !

Hi Patrick, Hi List,

Hey Patrick, you cannot set values on msql that way. mSQL does not
understand if you "SET value=value+1." You first must add 1 to value
then SET the result to the new value.

Like this:
1. select the value from the table
2. assign the value to a php variable
3. add 1 to the php variable
4. update the value on the table with the added php variable

All right? Calculations during queries are not allowed. Sorry.

Bye,
Fernando Maior

Patrick LECROSNIER wrote:

> Hi,
>
> With php2 and msql, I don't arrive to add 1 to a variable.
>
> I make :
>
> msql($base, "UPDATE $tableC SET deb = deb + 1 WHERE ident =
> '$dest'");
>
> But "deb = deb + 1" if not good :-(
> I want add 1 to "deb".
>
> Can you help me please ?
>
> Thanks.
> Patrick