I used this code to upload the picture. I got this code from stackoverflow. I am still unable to upload the image. I changed the db connection settings in table settings 2. I made the table but I am not sure whether the properties of the table I created are correct.
<html>
<head><title>Store Some Binary File to a DB</title></head>
<body>
<?php
if ($submit) {
$conn = mysql_connect("localhost", "your_username", "your_password")
or die ("Error connecting to database.");
mysql_select_db("your_database", $conn)
or die ("error connecting to database.");
$data = addslashes(file_get_contents($_FILES['form_data']['tmp_name'])
$result = mysql_query ("INSERT INTO your_table ".
"(description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name',".
"'$form_data_size','$form_data_type')",
$conn);
$id = mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b>";
mysql_close();
} else {
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
</body>
</html>
Also, help me in retrieving the image from the database and showing it on a page.
do u think thiis will work now?