I have this query:
UPDATE phonecalls
SET Called = \"Yes\"
WHERE PhoneNumber = \"999 29-4655\"
My table is phonecalls
, I
Check to make sure this returns some result.
SELECT * FROM phonecalls WHERE PhoneNumber = '999 29-4655'
If it doesn't return any result than the filter WHERE PhoneNumber = '999 29-4655'
is not correct.
That's my sugestion:
UPDATE `phonecalls` SET `Called` = 'yeah!' WHERE `PhoneNumber` = '999 29-4655' AND `Called` != 'yeah!'
And make sure with the case-sensitive name of table and field`s.
The problem might be that there are no records with PhoneNumber == "999 29-4655"
.
Try this query:
SELECT * FROM phonecalls where PhoneNumber = '999 29-4655'
If it doesn't return anything, then there are no rows that match.
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