OK, so first of all what you are attempting to do is SO not clear.
However, I'm going to make some assumptions and see if I can get this right.
So...
You have a list of roles and a list of candidates to fill those roles.
You are generating a form based on theses roles and candidates.
What you want is for the user to pick a single candidate for each role.
These roles come from the database, and therefore the number of roles may not be consistent each time you generate the form.
So far so good?
You are generating your form along these lines:
while($results = mysqli_fetch_assoc($sql){
while($results2 = mysqli_fetch_assoc($sq2l){
print('<input type="radio" name="'.$results['name'].'" value="'.$results2['value'].'" />'.$results2['value'].'<br />');
}
}
which is going to give you something like this:
<input type="radio" name="President" value="Mitt Romney" />Mitt Romney<br />
<input type="radio" name="President" value="Barack Obama" />Barack Obama<br />
...
<input type="radio" name="Vice-President" value="Mitt Romney" />Mitt Romney<br />
<input type="radio" name="Vice-President" value="Barack Obama" />Barack Obama<br />
...
Now because you are using radio buttons, when you submit the form you will get 1 option per role (ie 1 for President and 1 for Vice-President)
Now as the number of roles may vary, I would suggest using a for loop and a switch statement on the page that you post the data to. ie
if(!empty($_POST)){
foreach($_POST as $field => $value){
switch($field){
case 'President':
//process the president
break;
case 'Vice-President':
//process the vice-president
break;
default:
//do something else
}
}
}
Now this may not work for you, depending on what you want to do with the form data once it is submitted, but hopefully it will give you an idea to play with.
PS. This code has NOT been tested so it may not work straight up