Allow selecting by login.
This commit is contained in:
parent
ff7d7ac86d
commit
19dae67b95
@ -27,9 +27,9 @@ class User
|
|||||||
public $room;
|
public $room;
|
||||||
public $block;
|
public $block;
|
||||||
|
|
||||||
public function __construct($userid)
|
public function __construct($user)
|
||||||
{
|
{
|
||||||
$user_query = db::c()->query('SELECT * FROM users WHERE id = ?i', $userid)->fetch_assoc();
|
$user_query = db::c()->query('SELECT * FROM users WHERE id = ?i OR login = "?s"', $user, $user)->fetch_assoc();
|
||||||
foreach ($this as $key => $value) {
|
foreach ($this as $key => $value) {
|
||||||
if (isset($user_query[$key])) {
|
if (isset($user_query[$key])) {
|
||||||
$this->$key = $user_query[$key];
|
$this->$key = $user_query[$key];
|
||||||
|
Loading…
Reference in New Issue
Block a user