Just a simple question, is this a valid MySQL query? In particular, the AND statement.
"UPDATE table SET field1 = 5,field2 = 10 WHERE field3 = 20 AND field4 = 40"
When I execute this, it returns that 0 rows were affected when the entry definitely exists and should have been updated.
Thanks in advance!
edit: Ah, I’m using mysql_affected_rows afterwards…does this not work for UPDATE queries? Is there a way to find out whether any records were updated?
Take the WHERE part from your UPDATE and try running using it with a SELECT. Like:
SELECT * FROM table WHERE field3 = 20 AND field4 = 40
Any row(s) now?