mirror of
https://github.com/sigmasternchen/webcli
synced 2025-03-15 22:28:54 +00:00
some functions to get user informations
This commit is contained in:
parent
e5f92df02a
commit
9a8bb1c417
1 changed files with 14 additions and 0 deletions
14
backend/userManager.php
Normal file
14
backend/userManager.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
require_once("mysqlConnect.php");
|
||||||
|
|
||||||
|
class userManager {
|
||||||
|
static public function getUserById ($ID) {
|
||||||
|
global $db;
|
||||||
|
return $db->query("SELECT * FROM `users` WHERE `ID`=" . $ID)->fetch_object();
|
||||||
|
}
|
||||||
|
static public function getIdByUsername ($username) {
|
||||||
|
global $db;
|
||||||
|
return $db->query("SELECT `ID` FROM `users` WHERE `name`='" . $db->real_escape_string($username) . "'")->fetch_object()->ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in a new issue