Click to See Complete Forum and Search --> : Problem with UPDATE query


Aranell
07-13-2007, 08:44 AM
Hi all, I'm currently developing a Bookmarking system using PHP/MySQL and I've stumbled across an error in a query that I just can't see that problem with and was wondering if someone here could cast a fresh set of eyes over it.

UPDATE bookmarks SET read = '1' WHERE bookmark_id = '31' AND user_id = '4'

The error message returned just keeps saying that the SQL syntax in incorrect but to be honest I can't see how :S

Thanks in advance

A

bubbisthedog
07-13-2007, 10:51 AM
Are all of those fields alpha? Drop the single quotes for numeric fields. Otherwise, I see no problem with the DML.

mattyblah
07-13-2007, 11:58 AM
no exact error? As in, there is an error near... . I'm guessing you're using a reserved word, perhaps read? try this:

update [bookmarks] set [read] = '1' where [bookmark_id] = '31' and [user_id] = '4'.