fixed multiple database queries
This commit is contained in:
+9
-4
@@ -7,7 +7,8 @@
|
||||
|
||||
class u
|
||||
{
|
||||
private $id;
|
||||
private $user_id;
|
||||
|
||||
|
||||
/**
|
||||
* u constructor.
|
||||
@@ -15,14 +16,18 @@ class u
|
||||
*/
|
||||
public function __construct($playerId)
|
||||
{
|
||||
$this->id = $playerId;
|
||||
if (!$this->user_id) {
|
||||
$this->user_id = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @return array
|
||||
*/
|
||||
public function i()
|
||||
{
|
||||
return db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',$this->id)->fetch_assoc();
|
||||
return $this->user_id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user