php - Form built from database array values is not limiting radio buttons to single selection -


i trying build form user selects item based upon array of values database table. here code using filter out list:

$arrlength=count($results);  $listsubscriptions = '<form>'; for($x=0; $x<$arrlength; $x++)   {     $itemlist =    $results[$x]->item_name;     $listsubscriptions .= '<input type="radio" name="'.$itemlist.'" value="'.$itemlist.'"> '.$itemlist.'<br>';   }   $listsubscriptions .= '</form>';   return $listsubscriptions; 

when print results of form able radio buttons display them to, problem selection not being limited 1 radio button selection. ideas why?

the radio buttons must share single name attribute belong same group:

$listsubscriptions .= '<input type="radio" name="subscription" value="' . $itemlist . '"> ' . $itemlist . '<br>'; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -