nbarone Posted February 25, 2010 Share Posted February 25, 2010 I'm hoping someone here will have a better eye at catching this error than I have. Thanks in advance. Actual code: $sql = "INSERT INTO mfl_files (file_name, file_share, file_path, file_created, file_modified, file_lastVerified, file_active) VALUES ('$file', '$shr_id', '$dir', '$dateCreated', '$dateModified', '$newDateVer', '1')"; $sql output: INSERT INTO mfl_files (file_name, file_share, file_path, file_created, file_modified, file_lastVerified, file_active) VALUES ('09-6-2009-dvd.mov', '1', '\\fileserver01\SHARE01\VIDEO\DVD Files\2009\', '2009-11-24 09:33:11', '2010-02-03 16:37:34', '2010-02-25 10:37:28', '1') 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 '2009-11-24 09:33:11', '2010-02-03 16:37:34', '2010-02-25 10:37:28', '1')' at line 2 Link to comment https://forums.phpfreaks.com/topic/193359-phpmysql-error/ Share on other sites More sharing options...
developerdave Posted February 25, 2010 Share Posted February 25, 2010 What type of field are the 'file_created, file_modified, file_lastVerified' columns your trying to put datetime into? Link to comment https://forums.phpfreaks.com/topic/193359-phpmysql-error/#findComment-1018055 Share on other sites More sharing options...
nbarone Posted February 25, 2010 Author Share Posted February 25, 2010 They are all datetime fields. Link to comment https://forums.phpfreaks.com/topic/193359-phpmysql-error/#findComment-1018059 Share on other sites More sharing options...
shlumph Posted February 25, 2010 Share Posted February 25, 2010 You're escaping the single quotation.. try changing \\fileserver01\SHARE01\VIDEO\DVD Files\2009 to \\fileserver01\SHARE01\VIDEO\DVD Files\2009\\ Link to comment https://forums.phpfreaks.com/topic/193359-phpmysql-error/#findComment-1018061 Share on other sites More sharing options...
nbarone Posted February 25, 2010 Author Share Posted February 25, 2010 You're escaping the single quotation.. try changing \\fileserver01\SHARE01\VIDEO\DVD Files\2009 to \\fileserver01\SHARE01\VIDEO\DVD Files\2009\\ Thanks, that was the issue. Link to comment https://forums.phpfreaks.com/topic/193359-phpmysql-error/#findComment-1018070 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.