I am sending the results of a loop by post to a php file for processing (insertion into db). But I'm not sure how to get the results out in the most efficient way. right now it's either 1. updating $_POST['name-id'] and $_POST['occupation-id] or 2. creating $_POST['new_name-#'] and $_POST['new_occupation-#] with a variable # starting at 1 and counting up.
I am stuck on an efficient way of pulling all that data out and transferring it to variables + how to separate the names from the new names
in php document one there is basically a 2 column table in a form that is method post and on submit goes to the other php file. code is a bit convoluted so wanted to hold off on putting it all up"
while ( $tracks = mysql_fetch_array($trackstring) ){
echo "<li class=\"tracklist\"><input type=\"text\" name=\"tracknum-".$tracks['song_id']."\" id=\"tracknum-".$tracks['song_id']."\" value=\"".$tracks['song_tracknumber']."\"/>
<input type=\"text\" name=\"trackname-".$tracks['song_id']."\" id=\"trackname-".$tracks['song_id']."\" value=\"".$tracks['song_title']."\"/></li>";
}
for ($i = 0; $i < ( (mysql_num_rows($trackstring) < 1) ? 20 : 5 ); $i++){
//for($i=1; $i< $numtracks; $i++){
$count++;
echo "<li class=\"tracklist\"><input type=\"text\" name=\"newtracknum-".$count."\" id=\"newtracknum-".$count."\" value=\"\"/><input type=\"text\" name=\"newtrackname-".$count."\" id=\"newtrackname=".$count."\" value=\"\"/></li>";
}
and I need to pull that out in the other php file and sort it so that I can take the trackname-# and tracknumber-# in the value to update the id# of the db. I feel like I might be able to get it working by passing some invisible things into the array