Still fighting with my array. Here's a little background if it will help.
viewtopic.php?f=1&t=126284
viewtopic.php?f=1&t=126542
I also don't have all of my code with me, but I have a few samples...
Basically, I'm trying to collect some information for a 2D array. I have a schedule for a softball league, and I'm trying to re-schedule games that get marked as "postponed." Here's the easy way to see the data...

There's also a checkbox on the far right, and a hidden field with a game number on the left.
Here's how I setup my table. (Yes, I know I didn't choose the best field names, but I'm no where near production. When I go to production, I'll have better field names.
Code: Select all
$i=0;
while($row = mysqli_fetch_assoc($result)) $result is the SQL query of the games on a date that may need to be postponed
{
extract ($row); #Pulls result, one row at a time
$f_Date = date("F j", strtotime($Date)); #Formats date and time
$f_Time = date("g:i A", strtotime($Time));
echo "<input type = 'hidden' name = 'Number[$i]' value = '$Number' />
<tr>\n
<td align='center'><input type = 'hidden' name = 'Date[$i]' value = '$Date' />$f_Date</td>
<td align='center'><input type = 'hidden' name = 'Time[$i]' value = '$Time' />$f_Time</td>
<td align='center'><input type = 'hidden' name = 'Field[$i]' value = '$Field' />$Field</td>
<td align='center'><input type = 'hidden' name = 'Division[$i]' value = '$Division' />$Division</td>
<td align='center'><input type = 'hidden' name = 'AwayColor[$i]' value = '$AwayColor' />$AwayColor</td>
<td align='center'><input type = 'hidden' name = 'AwayManager[$i]' value = '$AwayManager' />$AwayManager</td>
<td align='center'><input type = 'hidden' name = 'HomeColor[$i]' value = '$HomeColor' />$HomeColor</td>
<td align='center'><input type = 'hidden' name = 'HomeManager[$i]' value = '$HomeManager' />$HomeManager</td>
<td align='center'><input type='checkbox' name='rain[$i]' /></td>
</tr>\n";
$i++;
}
echo "</table><BR /><BR />\n
<input type='submit' value='Postpone Selected Games'>
</form>"; #Submit button
Code: Select all
Array
(
[Number] => Array
(
[0] => 103
[1] => 108
[2] => 107
[3] => 106
[4] => 102
[5] => 100
[6] => 101
[7] => 99
[8] => 105
[9] => 104
[10] => 109
[11] => 110
)
[Date] => Array
(
[0] => 2011-01-21
[1] => 2011-01-21
[2] => 2011-01-21
[3] => 2011-01-21
[4] => 2011-01-21
[5] => 2011-01-21
[6] => 2011-01-21
[7] => 2011-01-21
[8] => 2011-01-21
[9] => 2011-01-21
[10] => 2011-01-21
[11] => 2011-01-21
)
[Time] => Array
(
[0] => 18:00:00
[1] => 18:00:00
[2] => 18:00:00
[3] => 18:00:00
[4] => 18:00:00
[5] => 18:00:00
[6] => 18:00:00
[7] => 18:00:00
[8] => 18:00:00
[9] => 18:00:00
[10] => 20:00:00
[11] => 20:00:00
)
etc etc etc
Code: Select all
Array
(
[0] => Array
(
[Number] => 103
[Date] => 2011-01-21
[Time] => 10:00:00
[Field] => PP3
etc etc etc.....
)
[1] => Array
(
[Number] => 105
[Date] => 2011-01-21
[Time] => 10:00:00
[Field] => FR2
etc etc etc.....
)
I tried reversing the data on my table, going from <input type = 'hidden' name = 'Date[$i]' value = '$Date' /> to <input type = 'hidden' name = '$i[Date]' value = '$Date' />, but to no avail.... I got nothing in the array when I did that...
