Re: Loop an INSERT from form

2001-07-14 Thread David
Getting closer: After fixing the form I get: Add songs for Record Array INSERT INTO songs VALUES (' blah', ' ***', ' ', ' 1', ' ')Songname[1]=: blahblah INSERT Failed, check the code. Here is the code: $vals=''; for ($i=0; $i<= $songsinalbum; $i++) { $vals .=", ('$songname[$i]', '$rat

Re: Loop an INSERT from form

2001-07-14 Thread David
Thanks for the help I tried your code and received error. Warning: No ending delimiter '^' found in addsongs.php on line 26 Songname: Array INSERT Failed, check the code. The code was: $vals=preg_replace('^,', '', $vals); // chop leading comma Is the ^ an escape character so you can en

RE: Loop an INSERT from form

2001-07-14 Thread Don Read
On 14-Jul-01 David wrote: > I need to insert x amount of rows from one form. The form displays x > amount of rows. I then need to insert the values from the form x amount > of times. The form loop works fine but how do I INSERT x amount of > times within a loop from the values of the form? I

Re: Loop an INSERT from form

2001-07-14 Thread Werner Stuerenburg
While loops are quite dangerous when the stop condition never occurs. This is the case here. You must increment $i to get a break condition to step out of the loop! Insert $i++; in your code and you will be fine. > This executes when submit is hit: > $i = 1; > while ($i <= $songsinalbum) { > $qu