I'm trying to get a radiobuttongroup into a multiple insert query like this:

The form:
PHP Code:
echo '<table>
        <tr>
            <td></td>
            <td>
                '
._MALE.' <input type="radio" name="sex1" value="male" id="sex[]" checked />
                &nbsp;&nbsp;'
._FEMALE.' <input type="radio" name="sex1" value="female" id="sex[]" />
            </td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._FIRST_NAME.':</td>
            <td><input name="fname[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._LAST_NAMES.':</td>
            <td><input name="lname[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._EMAIL.':</td>
            <td><input name="email[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td colspan="2"><br><div style="border-bottom:1px solid #669900;"></div><br></td>
        </tr>
        <tr>
            <td></td>
            <td>
                '
._MALE.' <input type="radio" name="sex2" value="male" id="sex[]" checked />
                &nbsp;&nbsp;'
._FEMALE.' <input type="radio" name="sex2" value="female" id="sex[]" />
            </td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._FIRST_NAME.':</td>
            <td><input name="fname[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._LAST_NAMES.':</td>
            <td><input name="lname[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td align="right"><div align="right">'
._EMAIL.':</td>
            <td><input name="email[]" type="text" size="42"></td>
        </tr>
        <tr>
            <td colspan="2"></td>
        </tr>
</table>'

The insert query:
PHP Code:
   $sex $_POST['sex'];
    
$firstname $_POST['fname']; 
    
$lastname $_POST['lname'];
    
$email $_POST['email'];

for (
$i 0$i count($firstname); $i++) {
            
                
$gacode 'GA';
                
$gacode .= chr(rand(65,90));
                
$gacode .= time();
                
$gacode .= uniqid($prefix);
                
                
$nemail $email[$i];
                
$nfname $firstname[$i];
                
$nlname $lastname[$i];
                
$nsex $sex[$i];

$result $db->sql_query("INSERT INTO ".$prefix."_users (fname,lname,sex,email,validatecode) VALUES ('$nfname','$nlname','$nsex','$nemail','$gacode')");


Everything works fine except the radiobuttongroup thing... Where do I go wrong?