Parse error: syntax error, unexpected 'else' (T_ELSE) in C:\xampp\htdocs\primetimezone\primetime\admin\insert_post.php on line 71

else {
	
move_uploaded_file($image_tmp,"images/$post_image");
	
$insert_query = "insert into posts 
(post_title,post_date,post_author,post_image,post_keywords
,post_content) values ('$post_title','$post_date','$post_author',
'$post_image','$post_keywords','$post_content')";
}
if(mysql_query($insert_query)){
	
echo "<center><h1>Post Published 
Successfully!</h1></center>";

}

You need to show us what is above your else statement. As something above that is leading to your problem.

You forgot to close your if statement before the else?

You really shouldn’t be using mysql_ functions these days. They have been deprecated for several years and have removed entirely from the current versions of PHP. You need to be using mysqli_ or PDO.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.