mysql_query在会话期间不更新数据库

I'm currently logged in using a session, I want the user to be able to update their info. However on submit nothing happens. The session works because when I check the iduser email and password echo out. I think I might be writing the query wrong or I'm using the session incorrectly.Can someone explain why nothing in the database is being updated?

    <?php
session_start();
include "connect.php";
include "header.php";
$iduser=$_SESSION['logged_in']['iduser'];
$sql = mysql_query("SELECT * FROM `profile` WHERE `iduser` = '$iduser' ");      
while($row = mysql_fetch_array($sql)){
    $iduser = $row['iduser'];
    $password = $row['password'];   
    $email = $row['email'];                     
    $fnlname = $row['fnlname'];     
    $username = $row['username'];
    $joineddate = $row['joineddate'];                       
    $gender = $row['gender'];   
    $age = $row['age'];
    $location = $row['location'];
    $website = $row['website'];                         
}                       
echo "$iduser $password $email";                            
$form1 = <<<EOT
<div id="homebox1">
    <div id="logohome">
        <h2>Welcome</h2></br>
    </div>
    <div id="signupcolumn1">
        <p>Please fillout your info</p>
        <form id="signup2" action="signup_part2.php" method="POST">
            <p><input name="fnlname" placeholder="First and Last Name" type="text" size="50" required>*</br>
                <input name="username" placeholder="Username" type="text" size="50" required>*</br>         
                <input name="age" placeholder="Your Age" type="" size="50" required>*</br></p>
                <p><input style="text-align:left;" type="radio" name="gender" value="male"/>Male</br>
                    <input style="text-align:left;" type="radio" name="gender" value="female"/>Female</br>
                    <input style="text-align:left;" type="radio" name="gender" value="blank"/>Leave Blank</br></p>
                    <p><input name="location" placeholder="Location" type="" size="50" >Opt.</br>
                        <input name="website" placeholder="Website" type="" size="50">Opt. </br></p>
                        <input name="joineddate" placeholder="joineddate" type="hidden" size="50">
                        <input type="submit" name="submita" value="Next"> 
                    </div>
                </form>

EOT;

if(isset($_POST['submita'])){
//perform verification
        $fnlname = $_POST['fnlname'];
        $username = $_POST['username'];
        $age = $_POST['age'];
        $gender = $_POST['gender'];
        $location = $_POST['location'];
        $website = $_POST['website'];
        $joineddate = $_POST['joineddate'];
        $iduser=$_SESSION['logged_in']['iduser'];
        $fnlname = mysql_escape_string($fnlname);
        $username = mysql_escape_string($username);
        $age = mysql_escape_string($age);
        $gender = mysql_escape_string($gender);
        $location = mysql_escape_string($location);
        $website = mysql_escape_string($website);
        $sql1 = mysql_query("SELECT * FROM `profile` WHERE `username` = '$username' ");

        if(mysql_num_rows($sql1) > 0){
            echo "Sorry, that username already exists!";
        }else{  
            mysql_query("UPDATE profile SET fnlname='$fnlname' joineddate='$joineddate' gender='$gender' age='$age' location='$location' website='$website' WHERE iduser=$iduser ");
        }

}else{
    echo $form1;
}
?>

Your query should be like this

UPDATE profile SET fnlname='$fnlname', joineddate='$joineddate', gender='$gender', age='$age' ,location='$location', website='$website' WHERE iduser='$iduser'

You missed commas And if $iduser is a string you must encapsulate with single quote