i just need help regarding my code becuase i odnt have any idea where is the syntax error.
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
echo "Please select an image";
else
{
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$img_name = addslashes($_FILES['image']['name']);
$img_size = getimagesize($_FILES['image']['tmp_name']);
if ($img_size == FALSE)
echo "select valid image.";
else
{
if (!$insert = mysql_query("insert into testblob values('','$image','$img_name')"));
echo "Problem uploading!";
else
{
$lastid = mysql_insert_id();
echo "Image uploaded.<p />Your image:<p /><img src=get.php?id=$lastid>";
}
}
}
i just need to know where is the error. thnaks for the help. more power ..
if..elsewithout curly braces, but you really should just always use curly braces even if its only one line...if (!$insert=mysql_query("insert into testblob values('','$image','$img_name')"));should not have a;at the end..