Home > Database > Mysql Tutorial > Mysql 数据库更新错误的解决方法_MySQL

Mysql 数据库更新错误的解决方法_MySQL

WBOY
Release: 2016-06-01 13:22:10
Original
1028 people have browsed it

bitsCN.com 语句:

UPDATE test SET age=5 WHERE 'name‘='王莽'
Copy after login

  顾名思义就是把王莽的年龄改为5,但结果很无奈――

  影响行数为0,怎么回事,语法没错,哪里都没问题啊……

  随便改了改了,将name 的两个引号去掉,结果却无意间成功了――

  但是使用图形界面更改时,结果更让人迷惑――

  生成的代码是――

UPDATE `web`.`test` SET `age` = '20' WHERE `test`.`name` = '王莽' LIMIT 1 ;
Copy after login

  百思不得其解中……

  通过比对,发现我写的单引号和生成的单引号不一样,更是迷糊了……

  各种晕,各种迷糊,各种不解,到底哪个是完美的???

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template