Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in C:\xampp\htdocs\PhpFolder\upload.php on line 12

Hello
This is my code but I have found the error and I trying alot but I can not solv. please help
Error " Parse error: syntax error, unexpected ‘$sql’ (T_VARIABLE) in C:\xampp\htdocs\PhpFolder\upload.php on line 12"

My code is given.

<?php 
if (isset($_POST['submit'])) {

	$imgname = $_FILES['img']['name'];

	$tempimgname = $_FILES['img']['tmp_name'];

	$con = mysqli_connect('localhost','root','','test1') or die(mysqli_error());

	move_uploaded_file($tempimgname, "images/$imgname")

	 $sql ="INSERT INTO`images`(`image`) VALUES ('$imgname')";

	$run = mysqli_query($con,$sql);

	echo "Uploaded Successfully";
}


 ?>

Look at the line before line 12. Often when you see an “unexpected …” type of error message, that means that something before it did not end or close properly. So are there any missing closing brackets, or missing semi-colons?

There is a missing ; on this line.

I also agree with the recommendation of @WebMachine

It would have also been helpful to let us know which line is line 12

Thank You so much, it works

thanks a lot, it works

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