Hello sir iam trying to upload the image in database..this is my code
<html>
<head>
<body>
<form action="" method="POST" enctype="multipart/form-data">
<input type="file" name="image" accept="image/jpeg">
<input type="Submit" name="submit"/>
</form>
<?php
if(isset($_POST['submit']))
//connecting to database
$db = mysql_connect("localhost:3306","root","") or die(mysql_error());
//selecting our database
$db_select = mysql_select_db("tutorial",$db) or die(mysql_error());
$imageName = mysql_real_escape_string($_FILES["image"]["name"]);
$imageData = mysql_real_escape_string(file_get_contents($_FILES["image"]["tmp_name"]));
$imageType = mysql_real_escape_string(($_FILES["image"]["type"]));
if(substr($imageType,0,5) == "image")
{
mysql_query("insert into blob values('','$imageName','$imageData')");
echo "image upload";
}
else
{
echo "only images are allowed";
}
}
?>
</body>
</html>
when iam click the uplaod button the image upload is successfully displayed on the page..but when iam see the databse no fileds are uploaded plese help me sir