Skip to content
Snippets Groups Projects
Commit 9fbfcca3 authored by Iqbal's avatar Iqbal
Browse files

Merged branch 'crud-methods' of...

Merged branch 'crud-methods' of http://gitlab.informatika.org/DagoDev/TugasBesar1_2017 into login-and-register
parents 1b0f1e23 848490b1
Branches
No related merge requests found
......@@ -37,6 +37,19 @@ class User {
}
}
public static function GetAllUsernameAndPassword(PDO $conn) {
try {
$users = $conn->query("SELECT username, password FROM user")->fetchAll();
foreach ($users as $record) {
$result[$record['username']] = $record['password'];
}
return $result;
} catch (PDOException $e) {
echo "Error: ".$e->getMessage();
return false;
}
}
public static function GetUserById($id, PDO $conn) {
try {
$stmt = $conn->prepare("SELECT * FROM user WHERE id=?");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment