hi,
$filename and $picture are arrays (form values)
problem:
if i have two picture fields on the previous page $i is 0101 --> so there will be stored 4 rows in the table instead of 2.
would be apprecheated for help.
regards,
chris
foreach ($filename as $key => $val) {
//get array-value of filename
if($val !="") {
if (($picture != "none") and ($err == false)) {
for ($i=0; $i < count($picture); $i++) {
//get array-value of picture
print $i;
//store values to db
$return = mysql_query("INSERT INTO files (ID,filename,file) VALUES('$currID','$val','$picture_name[$i]')", $link);
if ($return == false) {
Error("Die Datenbank konnte nicht aktualisiert werden.<br>".mysql_error());
}
if (!copy($picture[$i], "files/$picture_name[$i]")) {
Error("Datei konnte nicht kopiert werden.<br>".mysql_error());
}
}
}
}
}