nats Posted December 20, 2008 Share Posted December 20, 2008 Hey guys, Can somebody plz identify the error in the following code to upload files on the Database... $sql = "INSERT INTO files1 SET title = "".htmlentities(stripslashes($_POST['title']))."", file_name = '".$fileName."', file_type = '".$fileType."', file_size = '".$fileSize."', file_content = '".$content."', file_extension = '".$file_info['extension']."'"; The error is displayed in the 2nd line of the code... Parse error: syntax error, unexpected '"' in C:\xampp\htdocs\nats_upload\upload.php on line 91 Quote Link to comment https://forums.phpfreaks.com/topic/137812-solved-syntax-error/ Share on other sites More sharing options...
MadTechie Posted December 20, 2008 Share Posted December 20, 2008 title = "".htmlentities(stripslashes($_POST['title']))."", should be title = '".htmlentities(stripslashes($_POST['title']))."', or title = \"".htmlentities(stripslashes($_POST['title']))."\", Quote Link to comment https://forums.phpfreaks.com/topic/137812-solved-syntax-error/#findComment-720281 Share on other sites More sharing options...
nats Posted December 20, 2008 Author Share Posted December 20, 2008 Thanks.....MadTechie...... Quote Link to comment https://forums.phpfreaks.com/topic/137812-solved-syntax-error/#findComment-720284 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.