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

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

主站蜘蛛池模板: 绥中县| 扶沟县| 自贡市| 荔波县| 三明市| 牟定县| 海宁市| 乃东县| 天镇县| 普格县| 扬州市| 大足县| 英吉沙县| 方城县| 镇原县| 奉化市| 砚山县| 西乌珠穆沁旗| 福海县| 寿阳县| 崇仁县| 渝中区| 逊克县| 沂南县| 兴城市| 太和县| 桃源县| 安国市| 岐山县| 望都县| 宜川县| 洛南县| 青海省| 黑龙江省| 巴塘县| 张家港市| 前郭尔| 仙游县| 磐安县| 肇东市| 龙游县|