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? Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/ 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. Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/#findComment-466817 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? Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/#findComment-466825 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. Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/#findComment-466843 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? Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/#findComment-466845 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. Link to comment https://forums.phpfreaks.com/topic/91084-general-queries-question/#findComment-466854 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.