I've looked through some posts around here, but am still struggling to get my code to work correctly....
I've got a form that is being dynamically created so I never know how many rows it will have, the number of columns is static though. Here is my current code...
echo '<form name = "confirmPlayers" enctype="multipart/form-data" action="page.php" method="POST">';
echo '<input type="hidden" name="confirm" value="1"/>';
echo '<input type="hidden" name="pg_function" value="match"/>';
echo '<table border = "1">';
echo '<tr> <td colspan = "7"> <b>Matched Members</b></td> </tr>';
echo '<tr> <td> Match </td> <td>Division</td> <td>Number</td> <td>Upload Number</td> <td>KDGA Name</td> <td>Upload Name</td> <td>Score</td></tr>';
while($row = mysql_fetch_array($result)){
echo "<tr>";
echo '<td> <input type="checkbox" name="match_chkBox[]" value="1" checked>';
echo '<td> ' . $row['division'] . ' </td>';
echo '<td> ' . $row['mplayer_number'] . ' </td>';
echo '<td> ' . $row['tplayer_number'] . ' </td>';
echo '<td> ' . $row['mfirst_name'] . ' ' . $row['mlast_name'] . ' </td>';
echo '<td> ' . $row['tfirst_name'] . ' ' . $row['tlast_name'] . ' </td>';
echo '<td> ' . $row['score'] . ' </td>';
echo "</tr>";
}
echo '<tr> <td>';
echo '<input type="submit" value="Submit" />';
echo '</td> </tr>';
echo '</table> </form>';
I've tried several variations on creating the array but just seem to be creating a mess. I basically need all of the information from each cell returned in order to pass on to the database for further processing. I was hoping to return an array with a row for each corresponding row in the generated table, and then keys/indexes for each column displayed. Right now if I use a print_r($_POST['match_chkBox']); then it is returning correctly with the number of rows I left checked before submitting, but any other changes.. not so pretty.
Would appreciate any help you can give... this is driving me nuts!