Commit 06694cdb by Mei Romauli Sagala

pengecekan login

parent aef5c9a6
<?php
global $con;
$con = mysqli_connect("localhost", "root", "");
if (!$con) {
die("database connect problem");
}
$db_use = mysqli_select_db($con, "mydb") or die("selet db problem !!");
function execQ($strQ){
global $con;
$res = mysqli_query($con,$strQ);
return $res;
}
function closeConn()
{
global $con;
$res = mysqli_close($con);
return $res;
}
function getUser($username,$password) {
$strQ = "SELECT * FROM member WHERE username='".$username."' AND password='".$password."'";
$resUsr = execQ($strQ);
if (mysqli_num_rows($resUsr) > 0) {
return $resUsr;
}else{
return NULL;
}
}
function getAdmin($username,$password) {
$strQ = "SELECT * FROM admin WHERE username='".$username."' AND password='".$password."'";
$resAdm = execQ($strQ);
if (mysqli_num_rows($resAdm) > 0) {
return $resAdm;
}else{
return NULL;
}
}
?>
\ No newline at end of file
Markdown is supported
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