atticus Posted November 11, 2007 Share Posted November 11, 2007 I can't find the error: Error, query failed : 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 ') VALUES ('album1.jpg', '38916', 'image/pjpeg', 'album1.jpg', '' $title = $_POST[title]; $cust = $_POST[cust_id]; $query = "INSERT INTO upload2 (name, size, type, path, title, cust_id,) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath', '$title', '$cust')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); it seems to come after "'$filePath'," Link to comment https://forums.phpfreaks.com/topic/76829-solved-syntax-error-message/ Share on other sites More sharing options...
marcus Posted November 11, 2007 Share Posted November 11, 2007 Do: $title = mysql_real_escape_string($_POST['title']); $cust = mysql_real_escape_string($_POST['cust_id']); $query = "INSERT INTO `upload2` (`name`,`size`,`typr`,`path`,`title`,`cust_id`) VALUES('$fileName','$fileSize','$fileType','$filePath','$title','$cust');"; mysql_query($query) or die("Error, query failed: " . mysql_error()); You had an extra comma after cust_id Link to comment https://forums.phpfreaks.com/topic/76829-solved-syntax-error-message/#findComment-388970 Share on other sites More sharing options...
atticus Posted November 11, 2007 Author Share Posted November 11, 2007 thanks, works great Link to comment https://forums.phpfreaks.com/topic/76829-solved-syntax-error-message/#findComment-388975 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.