User abdullah001rti

Member for: 7 months (since Oct 27, 2016)
Type: Registered user
Full name:
IDB Round (IDB Students Only):
Course Name(IDB Students Only):
TSP(IDB Students Only):
University/College:
Department:
Degree:
Website:
Facebook:
Location:
About:

Activity by abdullah001rti

Score: 220 points (ranked #179)
Questions: 1
Answers: 0
Comments: 1
Voted on: 0 questions, 0 answers
Gave out: 0 up votes, 0 down votes
Received: 0 up votes, 0 down votes

Wall for abdullah001rti

Please log in or register to post on this wall.
Pls Help me

Fatal error: Call to a member function prepare() on a non-object in D:\xamp2\htdocs\userLogin\functions.php on line 12
wrong this pls answer me

My Code: (Function.php) my PHP version is: 5.4.27 (Xampp server)
<?php
require "conn.php";
class LoginRegistration{
   
    function __construct(){
        $database = new DatabaseConnection();
    }
   
    public function registerUser ($username,$password,$name,$email,$website){
        global $pdo;
       
        $query = $pdo->prepare("SELECT id FROM useres WHERE username= ? AND email= ? ");
        $query->execute(array($username, $email));
        $num = $query->rowCount();
       
        if ($num == 0){
            $query= $pdo->prepare("INSERT INTO users (username,password,name,email,website) VALUES (?, ?, ?, ?, ?)" );
            $query->execute(array($username,$password,$name,$email,$website));
            return true;
        } else{
            return print "<span style='color:#e53d37'> Error... Uername/email alredy used. </span>";
        }
    }
}
 ?>
Oct 29, 2016 by Mamunuzzaman

Badges

Bronze

Verified Human x 1
100 Club x 1
...