Please Help!!
I have the following code which generates the error : warning: Invalid argument supplied for foreach() ..... it's probably WAY off from what I need, but to be pointed in the right direction would be wonderful
foreach($_POST['station_id'] as $stationID => $value) {
$insertStatement .= "INSERT into table (`song_id`, `station_id`) VALUES ('" . $_POST['song_id'] . "','$stationID');\n";
}
$insertThem = mysql_query($insertStatement);
Basically what I need to do is insert into table the song_id and station_id so that for each station_id a new row is created. (The station_id is from a Select Multiple field, the song_id is only one specific song)
i.e.
song_id | station_id1
song_id | station_id2
song_id | station_id3
Thanks for any help you may have! I really appreciate it. Cheers!