xander85 Posted February 14, 2008 Share Posted February 14, 2008 Hi, I recently switched servers, both are Linux and running the latest PHP and Mysql versions. However, I am getting errors with most MySQL queries and I have a feeling there is a difference with my PHP or Mysql installation that I'm not aware of. On my old server this query worked fine: INSERT INTO work_orders (id, site_id, workid, invnum, work_date, work_desc, main, out, mailed) VALUES ('15', '1', '12', '1205', '2008-02-05', 'test', '1', '1', '1') Now, I get the following error: 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 'out, mailed) VALUES ('15', '1', '12', '1205', '2008-02-05', 'test', '1', '1', '1' at line 1 What would cause this? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted February 14, 2008 Share Posted February 14, 2008 out is a reserved keyword (See: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). You need to escape it using backquotes. Quote Link to comment Share on other sites More sharing options...
xander85 Posted February 14, 2008 Author Share Posted February 14, 2008 Why would this have worked on my old server though? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 14, 2008 Share Posted February 14, 2008 It's new for Version 5 Also, you could have used `backticks` around it on your other querry. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 14, 2008 Share Posted February 14, 2008 Why did my first reply get deleted when you moved the Post to this forum? Quote Link to comment Share on other sites More sharing options...
trq Posted February 14, 2008 Share Posted February 14, 2008 Why did my first reply get deleted when you moved the Post to this forum? The entire post was removed because it was duplicated within this thread. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.