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

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

主站蜘蛛池模板: 金坛市| 增城市| 肇州县| 曲松县| 新郑市| 加查县| 兴业县| 云阳县| 独山县| 中方县| 阳朔县| 岐山县| 田东县| 宝清县| 辽阳市| 青海省| 航空| 华亭县| 台江县| 泰兴市| 长治市| 博湖县| 珠海市| 丹凤县| 拜泉县| 确山县| 尚义县| 武定县| 墨玉县| 张家口市| 长子县| 鸡泽县| 洞头县| 建宁县| 晋宁县| 呼图壁县| 淮北市| 德庆县| 深水埗区| 巴彦淖尔市| 米易县|