Shoutbox

What is wrong with this SQL query??? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: What is wrong with this SQL query??? (/showthread.php?tid=31638)

What is wrong with this SQL query??? by Jammie on 09-17-2004 at 05:50 PM

Hi.

I have now been bugged by this for the last half an hour and i cannot work out what is wrong with it. The query is:

code:
UPDATE `photo_sessions` SET time= 1095442814 WHERE sessionid= 'f9e4a5954785196010148e1c2567b556'


And i get the following error:

quote:
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement., SQL state 37000 in SQLExecDirect in d:\phpportal\work\projects\image\database.php on line 30
UPDATE `photo_sessions` SET time= 1095442814 WHERE sessionid= 'f9e4a5954785196010148e1c2567b556'


I would usually use mysql but im having to use access for this person.

Any help would be great as im rather baffled!

Jamie
RE: What is wrong with this SQL query??? by WDZ on 09-17-2004 at 06:04 PM

Hmm... I'm not sure, as I only use MySQL. Maybe you could try...

- enclosing the timestamp in quotes: SET time= '1095442814'
- enclosing the field name "time" in backquotes, because it might be a reserved keyword: SET `time`=


RE: What is wrong with this SQL query??? by Jammie on 09-17-2004 at 06:11 PM

the `time` fixed the problem. I didnt think of that.

Thanks!