Click to See Complete Forum and Search --> : UPDATE SET WHERE problem


Ronnie268
06-19-2009, 03:52 PM
I'm trying to update a table set using php/mysql.

The database is selected/logged on.

I send this query and it doesn't work.

UPDATE jjtanalytics_logs SET screenresolution='1280 x 1024', colourdepth='32 bit', pagetitle='Analytics Test', java='Supported', flash='10.0', WHERE ip='xxx.xxx.xxx.xxx' AND timestamp='1245433510' AND urlvisited='http://domain.tld/analytics/

Please could anyone tell me what's wrong with it.

Thanks,

Ronnie268

chazzy
06-20-2009, 10:40 AM
remove the comma before the WHERE clause.

Ronnie268
06-20-2009, 12:14 PM
Thanks - that worked brilliantly. BTW, I'd also forgotten to copy across the final ', so the query now looks like this:


UPDATE jjtanalytics_logs SET screenresolution='1280 x 1024', colourdepth='32 bit', pagetitle='Analytics Test', java='Supported', flash='10.0' WHERE ip='xxx.xxx.xxx.xxx' AND timestamp='1245433510' AND urlvisited='http://domain.tld/analytics/'