mi sapreste dire come mai mi compaiono i seguenti errori:
Notice: Undefined index: mimetype in C:\www\Img\nuovo2.php on line 19
Notice: Undefined index: filesize in C:\www\Img\nuovo2.php on line 20
Notice: Undefined variable: filedata in C:\www\Img\nuovo2.php on line 22
se il database l'ho creato correttamente... e il codice è questo..
Parte 1
	
	
	
		
parte 2
	
	
	
		
sembra proprio che mysql_fetch_assoc nn restituisca nulla.... come posso fare?
				
			Notice: Undefined index: mimetype in C:\www\Img\nuovo2.php on line 19
Notice: Undefined index: filesize in C:\www\Img\nuovo2.php on line 20
Notice: Undefined variable: filedata in C:\www\Img\nuovo2.php on line 22
se il database l'ho creato correttamente... e il codice è questo..
Parte 1
		Codice:
	
	<html>
<head>
<title></title>
</head>
<body>
<?php 
if(isset($_POST['submit'])) 
{ 
    mysql_connect('localhost','root','');
	mysql_select_db('img');
    $allowed = array('gif', 'png', 'jpg', 'jpeg'); 
    $file = isset($_FILES['file']) ? $_FILES['file'] : false; 
    $desc = isset($_POST['desc']) ? trim($_POST['desc']) : ''; 
     
    if(!$file) 
        die('Non hai caricato nessun file.'); 
    if($desc == '') 
        die('Non hai inserito nessuna descrizione.'); 
     
    $ext = explode('.', $file['name']); 
    $ext = $ext[count($ext) - 1]; 
   
    $contents = file_get_contents($file['tmp_name']); 
    $contents = base64_encode($contents); 
     
    $size = filesize($file['tmp_name']); 
     
    $sql = "INSERT INTO filestore (FILENAME,MIMETYPE,DESCRIPTION,FILEDATA,FILESIZE) VALUES "; 
    $sql .= "('{$file['name']}','{$file['type']}','{$desc}','{$contents}','{$size}')"; 
    $query = mysql_query($sql) or die("Impossibile eseguire la query: <b>". mysql_error() ."</b>"); 
    echo "Immagine caricata correttamente!"; 
    unlink($file['tmp_name']); 
} 
?> 
<form name="upload" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data"> 
    File: <input type="file" name="file" /> <br /> <br /> 
    Descrizione: <input type="text"  name="desc" maxlength="255" /> <br /> <br /> 
    <input type="submit" name="submit" value="Carica immagine" /> 
</form> 
</body>
</html>
	parte 2
		Codice:
	
	<html>
<head>
<title></title>
</head>
<body>
<?php 
    mysql_connect('localhost','root','');
	mysql_select_db('img');
$id = 4; 
$sql = "SELECT FILENAME,MIMETYPE,FILEDATA FROM filestore WHERE ID='{$id}'"; 
$result = mysql_query($sql) or die("Impossibile eseguire la query: <b>". mysql_error() ."</b>"); 
if(mysql_num_rows($result) == 0) 
    die('Impossibile trovare il file nel database.'); 
$file = mysql_fetch_assoc($result); 
header("Content-type: {$file['mimetype']}"); 
header("Content-length: {$file['filesize']}"); 
echo $filedata; 
?> 
</body>
</html>
	sembra proprio che mysql_fetch_assoc nn restituisca nulla.... come posso fare?