Tuesday, 13 August 2013

how to store image in db and retrieving from db using php

how to store image in db and retrieving from db using php

my code is html code is here
<html>
<head><title>firstpage</title>
</head>
<body>
<form action="file_upload.php" method="post"
enctype="multipart/form-data">
<label for="file">File name : </label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="submit">
</form>
</body>
and my php code is this
enter code <html>
<head><title>firstpage</title>
</head>
<body>
<?php
if($_FILES['file']['error']>0)
{
echo "Error:".$_FILES["file"]["error"]."<br>";
}
else
{
echo "Upload : ".$_FILES["file"]["name"]."<br>";
echo "Type : ".$_FILES["file"]["type"]."<br>";
echo "Size : ".$_FILES["file"]["size"]."<br>";
echo "Sorted in : ".$_FILES["file"]["tmp_name"];
}
?>
</body>
in this code error not come itz success
""Upload : xxx.JPG
Type : image/jpeg
Size : 349345
Sorted in : C:\wamp\tmp\php6AF0.tmp""

lik this o/p cuming... i wanna to add image to db n retriev image from db
n load that image in my page... please help me...

No comments:

Post a Comment