function __construct($id = -1) { if (self::$conn == Null) { self::$conn = mysqli_connect('localhost', 'root', 'iti', 'babyshop'); } if ($id != -1) { $query = "select * from users where uid={$id} limit 1"; $result = mysqli_query(self::$conn, $query); $user = mysqli_fetch_assoc($result); $this->id = $user['uid']; $this->name = $user['name']; $this->password = $user['password']; $this->email = $user['email']; //$this->isAdmine=$user['isAdmine']; $this->credite = $user['credit']; } }
function __construct($id = -1) { if (self::$conn == Null) { self::$conn = mysqli_connect('localhost', 'root', 'iti', 'E-commerce'); } if ($id != -1) { $query = "select * from users where id={$id} limit 1"; $result = mysqli_query(self::$conn, $query); $user = mysqli_fetch_assoc($result); $this->id = $user['id']; $this->name = $user['name']; $this->email = $user['email']; $this->password = $user['password']; $this->birthday = $user['birthday']; $this->address = $user['address']; $this->interests = $user['interests']; $this->job = $user['job']; $this->credit_limit = $user['credit_limit']; } }
public function __construct($id_user = -1) { if (self::$conn == Null) { self::$conn = mysqli_connect('localhost', 'root', 'iti', 'GEO') or die; } if ($id_user != -1) { $query = "select * from user where id_user={$id_user} limit 1"; $result = mysqli_query(self::$conn, $query); $user = mysqli_fetch_assoc($result); $this->id_user = $user['id_user']; $this->name_user = $user['name_user']; $this->password = $user['password']; $this->email = $user['email']; $this->credit_limit = $user['credit_limit']; $this->address = $user['address']; $this->birth_date = $user['birth_date']; $this->job = $user['job']; $this->interest = $user['interest']; } }
function __construct($id = -1) { if (self::$conn == Null) { self::$conn = mysqli_connect('localhost', 'root', 'iti', 'clothes_shop'); } if ($id != -1) { $query = "select * from users where id={$id}"; $result = mysqli_query(self::$conn, $query); $user_result = mysqli_fetch_assoc($result); $this->id = $user_result['id']; $this->name = $user_result['name']; $this->user_name = $user_result['username']; $this->email = $user_result['email']; $this->password = $user_result['password']; $this->birthdate = $user_result['birthdate']; $this->credit = $user_result['credit']; $this->interest = $user_result['interest']; $this->address = $user_result['address']; } }
public static function setConnection(mysqli $db) { self::$conn = $db; }
public static function setConnection(mysqli $newConnection) { self::$conn = $newConnection; }
public static function setConnection(mysqli $bridge) { self::$conn = $bridge; }