View Full Version : Upload Image into database

10-27-2007, 08:51 AM
Hey,guys! I have a form to upload image into database,which had a BLOB type column called banner to store the image.How can I specific it in INSERT statement?Thanks...

<form name="addMovie" method="post" action="<? echo htmlentities($HTTP_SERVER_VARS['PHP_SELF']); ?>"
<input type="file" name="banner" value="banner">

Validation for the file format is done.

if ($_FILES['banner']['type'] != "image/gif" || $_FILES['banner']['type'] != "image/jpeg")
$javascript = 'alert(\'Please upload image file with gif or jpeg format

10-27-2007, 09:01 AM
Insert a url/file path to the database and info if you want; store the photo in a directory, and you're done. Easier and less work for the database. Storing it in full will make the db bulky and slower.