Skip to content
Snippets Groups Projects
Commit 83a214af authored by Aldrich Valentino Halim's avatar Aldrich Valentino Halim
Browse files

added basic user model

parent 6e71aa79
1 merge request!42Projekers - 13515051 - Girvandi Ilyas
<?php
class User {
function getAllUser(){
$con = mysqli_connect('localhost','root','','projekers');
mysqli_select_db($con, 'projekers');
$sql = "SELECT * FROM user";
$result = mysqli_query($con, $sql);
mysqli_close($con);
return $result;
}
function getUserByUsername($username){
$con = mysqli_connect('localhost','root','','projekers');
mysqli_select_db($con, 'projekers');
$sql = "SELECT * FROM user WHERE username='" . (string)$username . "'";
$result = mysqli_query($con, $sql);
mysqli_close($con);
return $result;
}
}
\ No newline at end of file
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