[PHP] Problem Inserting Array of Rows from form

2001-07-15 Thread David
I am trying to insert an array of rows or values from a PHP form into a MySQL database. There are six columns in the table songs: id, songname, rating, video, album_id, movie. Here is what I get when I submit the form Add songs for Record Array INSERT INTO songs VALUES (' 1, blah', ' ***', '

Re: [PHP] Problem Inserting Array of Rows from form

2001-07-15 Thread Hank Marquardt
For one, as you've written it you have a mismatch of columns vs. fields -- You're combining id and name into one field for the insert -- thus you have five fields trying to be inserted into a table with six elemets. You should have a print of the mysql_error() in your debug code ... I bet if

Re: [PHP] Problem Inserting Array of Rows from form

2001-07-15 Thread David
I did add mysql_error which helped me solve part of the problem: I was missing a single quote in the $val line after $id[$i] and before songname : Here is the corrected code but there is still a problem, $vals .=, ('$id[$i]', '$songname[$i]', '$rating[$i]', '$video[$i]', '$album_id[$i]',