I hope that someone can help me with this.  I understood that if I do an 
update on a row in a table, I could use the SET row=row+1 and that would 
take what was in that row/column and add a 1 to it.  For some reason, it is 
doubling it.  My end result is always twice what it should be.  Can anybody 
explain what I am doing wrong?
I have a MySQL Update statement like the following.  The variables will 
either be a 1 (one) or a 0 (zero).
----------
"UPDATE $d
SET w = w+$win,
l = l+$loss,
t = t+$tie,
pts = pts+$pts,
max_pt = max_pt+$max_pt
where team_id = '$team_id' and sea_id = '$sea_id'";
----------

I even put the following line in right before the UPDATE to make sure that 
it was putting it in only once so that I could get a printout (I am using PHP):
echo "team $team_id - win $win, loss $loss, tie $tie<br>";
Why would my results in the database be double what they should be.  I even 
changed the first set from:
w = w+$win
to
w = w+1
and sure enough, instead of the expected result of 7, I got 14.

Thank You in Advance
Steve



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to