Hi Thanks for your prompt reply
Here is the section that works with no hitch gives me all the selection as per the user had done while filling up the form initially
<form name="frm1" method="post" action="sports.php?page=update">
<table cellspacing="0" cellpadding="0" border="0">
<?
$squery = "select * from user_sports";
$sresult = mysql_query($squery) or die ("Query Failed");
while( $row = mysql_fetch_array( $sresult ) )
{
$sports = explode(";",$row['sports']);
?>
<tr>
<td>
<input name="recordid[]" type="hidden" value="<? echo $row['urecord'] ?>">
<input name="sports[]" type="checkbox" id="sports[]" value="Football" <? if (is_array($sports) == TRUE) { if (in_array("Football", $sports)) echo "CHECKED"; } ?>>
Football<br> <input name="sports[]" type="checkbox" id="sports[]" value="Cricket" <? if (is_array($sports) == TRUE) { if (in_array("Cricket", $sports)) echo "CHECKED"; } ?>>
Cricket <br> <input name="sports[]" type="checkbox" id="sports[]" value="Basketball" <? if (is_array($sports) == TRUE) { if (in_array("Basketball", $sports)) echo "CHECKED"; } ?>>
Basketball
</td>
</tr>
<?
}
?>
</table>
</form>
Here is the section which does not work, for which i need to be able to update.
<?
if ($page == "update")
{
for ($j=0; $j < count($recordid); $j++)
{
if (count($sports[$j]) == 0) $sportslist = "None";
else
{
for ($i=0; $i < count($sports[$j]); $i++)
{
$sportslist .= $sports[$i].";";
}
}
echo $recordid[$j];
echo "<br>";
echo $sportslist;
echo "<br>";
//$utpquery = "UPDATE user_sports SET sports='$sportslist' where urecord = $recordid[$j]";
//$utpresult = mysql_query($utpquery) or die("Query failed 1");
}
//header("Location: sports.php");
//exit;
}
?>
Please let me know where it is going wrong