gigantorTRON Posted August 30, 2007 Share Posted August 30, 2007 Here's the query error: INSERT INTO work VALUES(9200, 'US', 'Work', NULL, NULL)ON DUPLICATE KEY UPDATE . name ='Work' 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 '' at line 1 Here's my SQL query: $query3 = "INSERT INTO work VALUES(" . $new_table->ID . ", 'US', " . "'" . $new_table->Firm . "'" . ", NULL, NULL)" . "ON DUPLICATE KEY UPDATE " . "name =" . "'" . $new_table->Firm . "'"; The source is coming from a tab delimited file that does key checks on the tables... Quote Link to comment https://forums.phpfreaks.com/topic/67322-solved-whats-wrong-with-my-query/ Share on other sites More sharing options...
akitchin Posted August 30, 2007 Share Posted August 30, 2007 there is no space between your closing parenthesis on the VALUES() list and the ON DUPLICATE KEY statement. Quote Link to comment https://forums.phpfreaks.com/topic/67322-solved-whats-wrong-with-my-query/#findComment-337756 Share on other sites More sharing options...
gigantorTRON Posted August 30, 2007 Author Share Posted August 30, 2007 Doh! I figured it out.... didn't have the primary key set!! Quote Link to comment https://forums.phpfreaks.com/topic/67322-solved-whats-wrong-with-my-query/#findComment-337841 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.