Users now have their own profile pages

This commit is contained in:
pikami
2016-06-20 15:13:59 +00:00
parent 8690bd730c
commit 713198629c
5 changed files with 105 additions and 21 deletions

View File

@@ -42,4 +42,18 @@ function GetUserByID($id){
return array(-1,-1,-1,-1);
}
}
function GetUserIDByName($name){
include_once "config/config.php";
$conn = GetConnectionToDB();
$stmt = $conn->prepare("SELECT * FROM users WHERE user=:name");
$stmt->bindParam(':name', $name);
$stmt->execute();
if($result = $stmt->fetch()){
$conn = null;
return $result[0];
} else {
$conn = null;
return -1;
}
}
?>