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'," Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
atticus Posted November 11, 2007 Author Share Posted November 11, 2007 thanks, works great 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.