I'm wanting to decrement a variable in a MySQL table by one everytime an UPDATE query is ran.
What I have is this, which isn't working:
UPDATE forum SET replys = reply-- WHERE fid = '$id'
Is this possible in any way, or am I going to have to run a SELECT and get the value first, decrement it, and then insert the new value into the UPDATE query?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…