Thanks. I tried allready (script above) without db like:
xy.php
...
$sports = array ("bball", "soccer", "badminton");
$i_max = count($sports);
for ($i=0;$i<$i_max;$i++) {
echo "<input type=\"checkbox\" name=\"sport[]\" value=\"".$sports[$i]."\"> ".$sports[$i]."\n";
}
query.php
...
$i_max = count($sport);
for ($i=0;$i<$i_max;$i++) {
echo (in_array($sport[$i],$sports)) ? $sport[$i]."" : $sport[$i]." selected";
}
It will show you like: soccer selected
I tried similar way in script above with db, didn't worked.
To put values in a db isn't same way ?