Hi there,
I've run into a problem: I know my idea is good, but there's something wrong in the syntax. What's going on:
I want to update multiple records into my database, and to do so I created a form (by looping) with the fields ISBN1, nrnu1, nrvorig1 and the next is ISBN2, nrnu2, nrvorig2 and so on and so on.
Now I want to update this form with one submitbutton into the table 'eigentien' by updating it with a loop. This was (is) my idea:
$i = 1;
while($i<=10)
$boek_query = "UPDATE eigentien SET
ISBN='$ISBN[$i]',nrvorig='$nrvorig[$i]'
WHERE
(nrnu) = ($i)";
$i++;
}
OK, the loop works fine (after WHERE it's even going perfect), the idea is good, but what is going wrong?
I want $ISBN[$i] to become ISBN1 (and ISBN2 in the next part of the loop etc etc) in the SQL-query but that doesn't happen! I get the errormessage: Undefined Variable.
What must I do? I've tried quotes and brackets instead of [$i] but nothing seems to work for me.
Any suggestion (and where can I find some documentation about this)
Thanks in advance,
Quasibobo