I just thought I would re-iterate something that I have mentioned a few times in my replies to threads on here in that if your code isn't working, one of the first things to do is actually test your query in the database (i.e. through phpMyAdmin).
The reason I am posting this is that even though I have advised people quite a few times to do this, I had a problem the other day with some very simple coding and very basic update query and I just couldn't work out what the problem was - there was no logical reasoning for it not to work.
Eventually I decided to test the query in phpMyAdmin and guess what, I got an error and I resolved the problem - just a silly missing comma between the 2 fields and values I wanted to update.
The moral of the story: Firstly I should follow my own advice:) and secondly please test your queries in the database - it can save you a lot of time, head scratching and save your sanity.