I am currently using a foreach loop to display some radio buttons like so
<?php
foreach($roles as $role){
$output .= '<div class="row">';
$output .= ' <input name="_'.$role->key.'" type="radio" id="'.$role->key.'" class="radio" />';
$output .= ' <label for="'.$role->key.'" style="text-transform: lowercase;">'.$role->name.'</label>';
$output .= '</div>';
}
?>
So thats fairly straight forward .... The bit that i need to do next is confusing ... i need to take the $role->key and see if it matches an entry in another table, if so, echo 'checked="checked"' on the radio button.
It will need to be matched by the $role->key and also the $userid.
Any help would be great.