Jump to content


Photo

operators *solved*


  • Please log in to reply
2 replies to this topic

#1 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 14 September 2006 - 09:49 PM

Hey guys,

would it be possible to add a number to a value in a row just by using mysql?

so say I have a value of 0 in 'email' and every time I click on a buttonit adds 1 to the existing value. I know how to do that with php but it seems a waste of ressources grabbing the current value from the table, adding 1 to it and then updating the table.

#2 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 14 September 2006 - 10:28 PM

UPDATE tablename SET column = column + 1


#3 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 14 September 2006 - 10:40 PM

thanks, works perfectly




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users