Update the database field one less than available



  • Like, I have a number seven in my field.

    What's one sql - a request to do six?

    Now's what I'm doing, what I'm calling a spleen first, getting a lot of pros and then I'm going to update it.

    UPDATE tracker_users SET `yellow` = '?' WHERE `id` = '$id_user'
    

    How do we do this without extra action?


  • QA Engineer

    UPDATE `table` SET `yellow`=`yellow`-1 WHERE `id`="1"
    

Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2