开发者

mySQL select ID edit Column

开发者 https://www.devze.com 2023-03-19 14:29 出处:网络
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 origi

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';
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号