Ciao allora:
creai un tabella con:

id,campo1,campo2,foto

i campi1 etc.. sono quelli che devi scegliere tu!

<form method="post" action="<? $PHP_SELF ?>" name="formData" enctype="multipart/form-data">
<input type="hidden" name="op" value="mod">

<label for="firstname" accesskey="f" class="testo2">Nome:</label>
<input type="text" name="titolo" maxlength="20">

<label for="firstname" accesskey="f" class="testo2">Descrizione:</label>

<textarea name="testo" cols="40" rows="10" wrap="soft" onKeyUp="contatore(this.form)"></textarea>

<label for="firstname" accesskey="f" class="testo2">Foto:</label>
<input type="file" name="foto1">


<input id="button" type="submit" value="Inserisci"/>
</form>

Codice PHP:
<?
if($_POST['op']=="mod"){
//cattura i dati dal modulo
$titolo=$_POST['titolo'];
$titoloaddslashes($titolo);

$testo=$_POST['testo'];
$testoaddslashes($testo);

$foto1=$_POST['foto1'];

$a=rand(19);
$b=rand(19);
$c=rand(19);
$d=rand(19);
$e=rand(19);
$f=rand(19);
$ante=$a.$b.$c.$d.$e.$f;

//immagine principale
$uploaddir "./uploads/";
$uploadfile $ante .$_FILES['foto1']['name'];
$uploadfile1 $uploaddir .$ante .$_FILES['foto1']['name'];
$time=time();
if (
move_uploaded_file($_FILES['foto1']['tmp_name'], $uploadfile1)) {
    print 
"$uploadfile1 Allegato was successfully uploaded. ";
} else {
    print 
"$uploadfile1 Possible file upload attack!  Here's some debugging info:\n";
}


$result mysql_query ("insert into tua_tabella(foto,campo1,campo2) values('$uploadfile1','$titolo','$testo')");

?>
ah dimenticavo nella stessa directory crea una carte chiamata "uploads".