Dear All
I've 15 records displaying in a page. Each record has a field called "Sports" which stores values separated by semicolon ";" "Football;Cricket;Basketball"
When I'm retrieving the values, i use explode and assign each values of check box. Works perfect with No Problem.
I'm storing the Record ID as a hidden field.
I'm the admin and I uncheck "Football" or "Basketball" in couple of records and click on Submit and give the following code
if ($action == "submit")
{
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].";";
}
}
$utpquery = "UPDATE user_sports SET sports='$sportslist' where urecord = $recordid[$j]";
$utpresult = mysql_query($utpquery) or die("Query failed 1");
}
header("Location: verifyrecord.php");
exit;
}
Once I execute the above, I check the Database and find the ones which I had Unchecked have become in Multiples
For e.g.
"Basketball;Basketball;Basketball;Basketball;Basketball;"
I don't know what am I doing wrong here.
Could anyone give me a Hint???
Thanks