Hello,
This is a piece of php code but I have got a problem. The problem is about the input in the database. I have got 5 different values for Nummer. These are nummmer1 - nummer5
I thought I could resolve the problem with a 'for' loop. Bur this doesn't work. When I manually type for example Nummer= '$Nummer1', this works, but with my 'for'-loop is doenst give the data in the database but something like 'Nummer1'. It must read de proper value.
Anyone a suggestion?
Thx in advance.
P.
if ($submit) {
for($i = 1; $i <= $aantal; $i++){
$Nummervar = "Nummer" .$i;
$Artiestvar = "Artiest" .$i;
echo $Nummervar;
// is er geen Id dan updaten anders editeren
if ($id) {
$sql = "UPDATE cd SET Nummer='$Nummervar',Artiest='$Artiestvar',Cd='$Cd' WHERE id=$id";
} else {
$sql = "INSERT INTO cd (Nummer,Artiest,Cd) VALUES ('$Nummervar','$Artiestvar','$Cd')";
}
// run SQL against the DB
$result = mysql_query($sql);
}
}


