数据库处理问题 - PDO插入问题

I'm developing a website for my university and it include having users and everything around it but i have problem with this code :

error_reporting(E_ALL);

function hashSSHA($password) 
{
    $salt = sha1(rand());
    $salt = substr($salt, 0, 10);
    $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
    $hash = array("salt" => $salt, "encrypted" => $encrypted);
    return $hash;
}





function storeUser($name, $email, $password) 
{


    $uuid = uniqid('fss_u', true);
    $hash = hashSSHA($password);
    $encrypted_password =  password_hash($password, PASSWORD_DEFAULT); // $hash["encrypted"]; // encrypted password
    $salt = $hash["salt"]; // salt
    $regday = date("Y-m-j");
    $type_user= 'admin';
    $db = new PDO('mysql:host=localhost:3308;dbname=fss-db', 'root', 'nabounanc1');

    echo $encrypted_password ;
    echo  '<br>';

    $query=$db->prepare('INSERT INTO fss_users (unique_id,username,email,password,salt,create_time,type_user) VALUES (:uuid, :name, :email, :encrypted_password, :salt, :regday, :type_user) ');
    $query->bindValue(':uuid', $uuid, PDO::PARAM_STR);
    $query->bindValue(':name', $name, PDO::PARAM_STR);
    $query->bindValue(':email', $email, PDO::PARAM_STR);
    $query->bindValue(':encrypted_password', $encrypted_password, PDO::PARAM_STR);
    $query->bindValue(':salt', $salt, PDO::PARAM_STR);
    $query->bindValue(':regday', $regday, PDO::PARAM_STR);
    $query->bindValue(':type_user', $type_user, PDO::PARAM_STR);


    $query->execute();


        // check for successful store

    if ($query->execute()) 
    {
        echo $query->rowCount();
        echo  '<br>';
       $result = $query->fetchAll();

        print_r($result);

        // get user details 
        $uid = $db->lastInsertId(); // last inserted id
        $query=$db->prepare("SELECT * FROM fss_users WHERE unique_id = :uid");
        $query->bindValue(':uid', $uid, PDO::PARAM_STR);
        $query->execute();




        //Message
        $message = "Bienvenue sur FSS Votre inscription a ete accepte pseudo = $email mot de passe = $password !";
        //Titre
        $titre = "Bienvenue sur FSS !";

        mail($email, $titre, $message);  // Mail to the new user 

        // return user details
        //return $query->fetchAll();
        echo 'it\'s good';
        echo  '<br>';

    } 
    else 
    {
        echo 'error';
        echo  '<br>';
        //return $false;
    }
}
$name = "bachirdiop";
$email = "testing@hotmail.com";
$password = "bachirdiop3";
storeUser($name, $email, $password);

Basically this function hash the password given by the user and stores it into a database and if everything is normal it should return the last recorded user but it doesn't. How can I fix this?