Codice PHP:
for($n 0$n<=5$n++)
{
   if(
$db_value == $n$checked[$n] = 'checked="checked"';
   else 
$checked[$n] = '';