官术网_书友最值得收藏!

UPDATE

The UPDATE statement modifies existing data in the database. You must specify a condition for the UPDATE command as otherwise, it will modify every single piece of data in a table, which is not our intended behavior. Try the following command, which will change the username and password of the first user:

UPDATE user SET username = "test1", password = "1234321" WHERE id = 1;

The command will fail, however, if the user with ID 1 does not exist. The command will also return the status 0 rows affected if the username and password data you provided matches exactly with the one stored in the database (nothing to change). For more information regarding the UPDATE statement, please refer to the following link:

 https://dev.mysql.com/doc/refman/5.7/en/update.html

主站蜘蛛池模板: 遵义县| 长岭县| 伊宁市| 延川县| 富蕴县| 彭州市| 双鸭山市| 新源县| 会昌县| 广河县| 淮滨县| 台安县| 尖扎县| 虹口区| 礼泉县| 龙岩市| 湘西| 交口县| 塔河县| 青田县| 平罗县| 河西区| 郎溪县| 靖远县| 建昌县| 安新县| 磴口县| 方山县| 阿勒泰市| 邮箱| 昌平区| 治多县| 北碚区| 论坛| 土默特右旗| 陈巴尔虎旗| 衢州市| 南陵县| 太保市| 武冈市| 越西县|