check it out:
<form action=form.php>
Select an image:<input type=file name=img>
</form>
form.php
if (is_uploaded_file($img))
{
//the name and type variables are
//automatically generated by PHP
$con = mysql_connect($localhost,$user,$pass);
mysql_select_db($db,$con);
$quer = "INSERT INTO images VALUES ";
$quer .="('$img_name','$img_type','$img_size')";
mysql_unbuffered_query($quer);
}
the code above doesn't include the controls that you have to do.But if you can get what is going on,you can handle the rest.
Good luck