db = new mysqli ($db_host, $db_user, $db_pass, 'goatoh_training', $db_port); } public static function find ( int $id): Self { $sql = " SELECT * FROM user WHERE id = $id"; $result = $this -> db -> query ($sql) or die ("db_select error $sql"); $row = $this -> db -> fetch_array ($result); $self = new Self; $self -> id = $id; $self -> name = $row['name']; $self -> pass = $row['pass']; return $self; } }