one important point: all textboxes are stored in the array, regardless or not they have values in them (they are stored as "" for value), so that keeps the order of the textbox. I was hoping to retrieve them with $predminutes2[0], $predminutes2[1], $predminutes2[2] etc, inserting blanks where there are and real values where there are.
That's why I did
PHP Code:
for( $i2=0; $i2 < count($predminutes2); $i2++) {
$minutes2="<input type=\"text\" name=\"predminutes2[]\" value=\"$predminutes2[$i2]\" size=\"10\">";
}
hoping to get values in order with [$i2]
-------------------------------------------------------------
post was merged
----------------------------------------------------------
OK, I renamed predminutes1 and 2 into gdata1 and gdata2 and here is my new array with playerid. That coorectly shows the last 3 players as scorers with their correct playerid
PHP Code:
[gdata1] => a:5:{s:10:"0000000002";s:0:"";s:10:"0000000003";s:0:"";s:10:"0000000004";s:5:"44 56";s:10:"0000000005";s:5:"12 29";s:10:"0000000006";s:2:"68";}
)
Not knowing what to replace 'checked' with from the other code, I did a test and placed 'OK'. That did not display
PHP Code:
$data1=unserialize($getplayers1['gdata1']);
$gavegoal1 = (in_array($playerid1, $data1) ? "ok" : "");
$minutes1 ="<input type=\"text\" name=\"predminutes1[$playerid1]\" value=\"$gavegoal1\" size=\"10\">";
however, while I see the playerid in the string above, this does not display them
foreach ($data1 as $value)
echo $value;