mySQL UPDATE查询返回"0行受影响". [英] mySQL UPDATE query returns "0 rows affected"

查看:831
本文介绍了mySQL UPDATE查询返回"0行受影响".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个查询:

UPDATE phonecalls 
   SET Called = "Yes" 
 WHERE PhoneNumber = "999 29-4655"

我的表是phonecalls,我有一列名为PhoneNumber.我要更新的是名为Called的列,为是".

知道我在做什么错吗?当我返回查询时,它说影响了0行.

called

的当前值

I have this query:

UPDATE phonecalls 
   SET Called = "Yes" 
 WHERE PhoneNumber = "999 29-4655"

My table is phonecalls, I have a column named PhoneNumber. All I want to update is a column named Called to "yes".

Any idea what I am doing wrong? when I return my query it says 0 rows affected.

解决方案

As amphetamine and Yada suggested, check with a SELECT, if your phone number is in the table.

But keep in mind: If the value for called of the row in question is already "Yes", mysql won't change the value and will therefore return "0 rows affected". So be sure to also check the current value of called

这篇关于mySQL UPDATE查询返回"0行受影响".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆