I have prepared a structure to manage the application into OOPS Manner in php, i am trying to connect database and insert the records into database, my connection is established but unable to add records into my DB-tables. Here is my codes My Model User class file: users.php (Which is a folder name class):
<?php
class Users extends Connection{
    public $con;
    public function __construct(){
        $this->con = new Connection();
    }
    //creating user
    public function createInfo($data){
        $username = $data['username'];
        $email = $data['useremail'];
        $password = md5($data ['password']);
        $query = "INSERT INTO js_users(username, useremail, `password`) VALUES ('".$username."', '".$email."', '".$password."')";
        $result = $this->con->query($query); 
        print_r($result); exit;
        return array("status"=>$result, "message"=>"User Generated Successfully");
     }
     public function getUserInfo(){
         $query  = "SELECT * FROM employee";
         $result = mysqli_query($this->con, $query) or die(mysqli_error($this->con));
         return $result;
     }  
}
My Model: Connection class file (Same in class folder):
<?php
class Connection{
    private $hostname;
    private $username;
    private $password;
    protected $dbname;
    public $con;
    public function __construct()
    {   
        $this->hostname = '127.0.0.1';
        $this->username = 'localuser';
        $this->password = 'R@5gull@';
        $this->dbname = 'jobsearch';
        $this->con = $this->connect();
        return $this->con;
    }
    private function connect(){
        $this->con =  new mysqli($this->hostname, $this->username, $this->password, $this->dbname);
        return $this->con;   
    }
}
?>
My HTML Form : (In root directory):
 <form class="user" action="process.php" method="post">
              <input type="hidden" name="actions" value="createUser" />
                <div class="form-group row">
                  <div class="col-sm-10 mb-3 mb-sm-0">
                    <input type="text" class="form-control form-control-user" id="username" name="data[username]" placeholder="Choose username">
                  </div>
                </div>
                <div class="form-group row">
                <div class="col-sm-10 mb-3 mb-sm-0">
                  <input type="email" class="form-control form-control-user" id="useremail" name="data[useremail]" placeholder="Email Address">
                </div>
                </div>
                <div class="form-group row">
                  <div class="col-sm-5 mb-3 mb-sm-0">
                    <input type="password" class="form-control form-control-user" id="password" name="data[password]" placeholder="Password">
                  </div>
                  <div class="col-sm-5">
                    <input type="password" class="form-control form-control-user" id="confirm_password" name="data[confirmPassword]" placeholder="Repeat Password">
                  </div> 
                  <div class="col-sm-2">
                  <span id="message"></span>
                  </div>
                </div>
                <button type="submit" name="submit"  class="btn btn-primary btn-user btn-block">
                  Register User
                </button>
              </form>
My Process.php:
<?php
function __autoload($class){
    require_once "class/$class.php";
}
$connect = new Connection();
$action = $_POST['actions'];
if(isset($action) && isset($_POST['actions'])){
switch($action){
    case "createUser":
        $createUser = new Users();
        $res = $createUser->createInfo($_POST['data']);
        print_r($res);
    break;
    default:
        return NULL;
    }
}
?>
my database schema:
CREATE TABLE `js_users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(155) NULL DEFAULT NULL,
    `useremail` VARCHAR(155) NULL DEFAULT NULL,
    `password` VARCHAR(255) NULL DEFAULT NULL,
    `created_on` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_on` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `username` (`username`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
As my connection has establish but records are not being pushed to the database, want to insert records via these methods.
 
     
    