Hi,
I'm using a form which a user predicts winning margins in a football fixtures list
Code PHP:while ($row = $res->fetch_array(MYSQLI_NUM)) { echo '<input type="hidden" name="fixture['.$row[0].']" value ="">'; echo '<tr><td>'.$row[2].'</td>'; echo '<td class="fixtures"><select name = "team1" id="team1"/><option value=""></option>'; for ($i = 1; $i < 31; $i++) echo '<option value="'.$i.'">'.$i.'</option>'; echo '</td>'; echo '<td class="fixtures"><input type="checkbox" name="f'.$row[0].'draw" id="f'.$row[0].'draw" value="1"/></td>'; echo '<td class="fixtures"><select name = "team2" id="team2"/><option value=""></option>'; for ($i = 1; $i < 31; $i++) echo '<option value="'.$i.'">'.$i.'</option>'; echo '</td>'; echo '<td>'.$row[4].'</td>'; echo '</tr>';
The code above retrieves a round of fixtures from a database and outputs team names, dropdown lists of winning margins and a checkbox for a draw e.g. Team 1 beats Teams 2 by 5 goals in fixture 1
I want to be able to insert each fixture prediction into my database when the user submits the form
At the moment my query string looks like
prelatfixh.php?fixture[1]=&team1=5&team2=&fixture[2]=&team1=&team2=&fixture[3]..........
How do I strip out the relevant value (in the example above - team1 in fixture 1 winning by 5 goals) for each fixture
Is this even the smartest way to approach this ?
Many thanks in advance
aor





Bookmarks