• gcc planet

    Fatal error: Uncaught Error: Call to a member function query() on null in C:xampphtdocsONLINE EXAMclassusers.php:19 Stack trace: #0 C:xampphtdocsONLINE EXAMsignup.php(14): users->signup(' insert into si…') #1 {main} thrown in C:xampphtdocsONLINE EXAMclassusers.php on line 19

    this is my user.php
    class users{
    public $host="localhost";
    public $username="root";
    public $pass="";
    public $dbname="college";
    public $conn;
    public function _construct()

    $this-> conn= new mysqli($this->$host,$this->$username,$this->$pass,$this->$dbname);
    if ($this->conn->connect_errno)
    die ("Database connection failed".$this->conn_connect_errno);
    public function signup($data)
    return true;



    this is my signup

    include ("class/users.php");
    $register= new users;
    extract ($_POST);
    $query=" insert into signup values ('','$name','$father','$mother','$email','$pwd','$img_name')";



    pls help me how i solve this

Leave a Reply

Your email address will not be published. Required fields are marked *