Hi,
I retrieve my sql data to multiple select box for user profile update page.
$colors = array("black", "Green", "blue");
$dbcolors= explode(',' ,$row['color']);
foreach ($colors as $color) {
if(in_array($color,$dbcolors)) {
echo "<input name=\"color[]\" type=\"checkbox\" value=\"$color\" CHECKED> $color ";
} else
{
echo "<input name=\"color[]\" type=\"checkbox\" value=\"$color\"> $color";
}
}
This worked perfectly, if user tick unchecked input ( worked ) but if user change any color ( if input checked change to unchecked ) send old checked input and not send new data to mysql database.
How To fix this?
Thanks