I have been inserting the file path in to data base but it s giving a mysql syantax error can any pne fix it
<?php
include 'db.php';
if($_SERVER['REQUEST_METHOD']=='POST')
{
if(isset($_FILES['photo'])&& is_uploaded_file($_FILES['photo']['tmp_name'])
&& $_FILES['photo']['error']==UPLOAD_ERR_OK)
{
if($_FILES['photo']['type']=='image/jpeg')
{
$tmp_img = $_FILES['photo']['tmp_name'];
$path = "d:/xampp/htdocs/upload/images/" .$_FILES['photo']['name'];
move_uploaded_file($_FILES['photo']['tmp_name'], $path);
$imgname=$_FILES['photo']['name'];
$q="Insert INTO image (name,imgpath) VALUES($imgname,$path)";
mysql_query($q) or die(mysql_error());
}
else
{
echo "Uploaded file was not a JPG image.";
}
}
else
{
echo "No file Uploaded";
}
}
?>