PDA

View Full Version : field_value++? (and look, an entirely unexplained apple icon)


Shecky
04-16-2004, 09:54 AM
Pretty basic, simple question for someone who has the mysql manual memorized.

Is there a way to increment up and down a numerical value being stored in a mysql field without having to SELECT it, do a $var++ or a $var--, then an UPDATE?

In my wildest dreams i thought it might be as simple as
UPDATE table SET field++ ...

I just want to poke at my db as little as possible, is all.

With any luck someone will answer this quickly and it'll drop off the front page before too many people have a chuckle at my newbiness. :cool:

raf
04-16-2004, 10:04 AM
UPDATE table SET field = field+1