My table is named users
. I have a column named ID
and module
. Using mySQL syntax how can i say 'get the column id that equals 3 and update the column modul开发者_运维问答e to increment from its original number plus 1'
update users set module = module + 1 where id = 3;
Your question isn't super-clear, but is this what you want?!
UPDATE users
SET module = module + 1
WHERE ID = 3;
UPDATE users
SET module = module + 1
WHERE ID = 3;
UDPATE users
SET module = module + 1
WERE ID = 3
What is it, homework? :-)
"UPDATE users SET module = module + 1 WHERE id=3";
That should get you what you want.
To do it in MySQL:
UPDATE myDB.users SET module = module + 1 WHERE ID = 3
Do you need to know how to do this with php as well?
Try this:
update `users` set `module` = `module` + 1 where `id` = '3';
精彩评论