User function construct user.class I'm trying to create my user.class.php constructor but I don't know really much about POO so I'm going to tell you what I'm doing and I hope you could help me.

user.class.php

class user {
    private $fullname;
    private $age;
    private $email;
    private $sex;
    private $nacionality;

        public function __construct($usrId){
            $mysqli = new connection_mysqli(); // I've already implemented this and it works.
            $query = "SELECT * FROM USERS WHERE USER_ID = $userId";
            if ($result = $mysqli-&gt;query($query)) {
               $userData = $result-&gt;fetch_assoc(); 
               $this-&gt;fullname = $userData['fullname'];
               $this-&gt;age = $userData['age'];
               $this-&gt;email = $userData['email'];
               //.....
            }
        parent::__construct($usrId);

    }
}


What I'm going to do on my index.php is this:

index.php

&lt;?php
include('scripts/class/user.class.php');
$user = new user($_SESSION['userid'];
echo $user-&gt;fullname;
?&gt;


So, is this going to work right? Is this well-programmed? Any tips?
First of all I recommend you to setup a local webserver to test your php code, if you have not done so jet (I assume you haven't tried your code, since your asking if it's going to work).

Secondly you should abandon mysqli for PDO. Read PHP Database Access: Are You Doing It Correctly?

Also, why are you calling the parent's constructor when the user class has no parent (eg. the class does not extend another class)?