Lionel
12-29-2005, 08:24 PM
Please someone help me. The below returns only one checkbox checked.
When I echo the two comparative values $player1[$p1] and $predplayer1 separately, the results are there. So if I have more than one result why is only one checkbox checked?
$predplayer1="$playerlname1 $playerfname1";
$player1=unserialize($getplayers1['players1']);
for ($p1 = 0; $p1 < count($player1);$p1++)
{
if ($player1[$p1]==$predplayer1){
$checkbox1 ="<input type=\"checkbox\" name=\"predplayer1[]\" value=\"$predplayer1\" checked>";
}
else {
$checkbox1="<input type=\"checkbox\" name=\"predplayer1[]\" value=\"$predplayer1\">";
}
}
When I echo the two comparative values $player1[$p1] and $predplayer1 separately, the results are there. So if I have more than one result why is only one checkbox checked?
$predplayer1="$playerlname1 $playerfname1";
$player1=unserialize($getplayers1['players1']);
for ($p1 = 0; $p1 < count($player1);$p1++)
{
if ($player1[$p1]==$predplayer1){
$checkbox1 ="<input type=\"checkbox\" name=\"predplayer1[]\" value=\"$predplayer1\" checked>";
}
else {
$checkbox1="<input type=\"checkbox\" name=\"predplayer1[]\" value=\"$predplayer1\">";
}
}