#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    18
    Rep Power
    0
    Is there a way of getting mysql to add a value to an already set data field without having to select the current value, add the increment in php then update the field with the new value.

    I want to take an existing 'count' field and add one to it, but i want to do it in one request to the database.
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    update table set field=field+1 where foo;

Similar Threads

  1. Replies: 4
    Last Post: February 22nd, 2004, 06:09 PM

IMN logo majestic logo threadwatch logo seochat tools logo