Click to See Complete Forum and Search --> : mySQL Query problems


bejitto101
11-13-2007, 01:01 PM
I can not for the life of me find out what is wrong with this query:

UPDATE Fees_1 SET category='Facilities', desc='This is an invoice', due=200.00, date='ASDASD' WHERE invoice=1

It must be simple but I'm just not seeing it. The error message i keep getting is:

Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc='This is an invoice', due=200.00, date='ASDASD' WHERE invoice=1' at line 1

I've triple checked my syntax and I haven't a clue what its being pissy about.

dave17
11-13-2007, 03:02 PM
just looking at it quickly, you should be careful with the use of mysql key words (both desc and date). try putting `'s around those ones, (ie: UPDATE Fees_1 SET category='Facilities', `desc`='This is an invoice', due=200.00, `date`='ASDASD' WHERE invoice=1) so it doesnt try to interpret those as keywords. not sure if it'll fix it or not though.

bejitto101
11-13-2007, 03:13 PM
Yep, that fixed it! It didn't like the field name desc. Thanks a bunch!