Hello. I am a newbie so bare with me please. I'm making a site where users have a profile page. I want them to be able to upload a pic of themselves to their profile. I am trying to store the pic in a "blob" file in mysql. I have a script that I am able to browse the files of pics but I can't seem to get the insert statement to work to insert the file into the database so I can call it up later.. Here's what I have without the insert statement. Any ideas?
<formname="form1" method="post" action="http://mysite.com/picture.php" enctype="multipart/formdata">
<input type="hidden" name="max_file_size" value="1000">
<input type="file" name="imagefile">
<input type="submit" name="submit" value="submit">
if(isset($submit) && $submit=="submit")
{
if($files['imagefile']['type']=="image/jpg")
{
copy($files['imagefile']['tmp_name'],"files/".$_files['imagefile']['name'])
or die("Could not copy");
echo"";
echo "Name: ".$files['imagefile']['name']."";
echo "Size: ".$files['imagefile']['size']."";
echo "Type: " .$_files['imagefile']['type']."";
echo "Copy done....";
}
else{
echo"";
echo "Could Not Copy, Wrong Filetype(".$_files['imagefile']['name'].")";
}
}
?>