Postingan lainnya
Cara fix mysqli_fetch_row() expects parameter 1 to be mysqli_result, bool given gmna?
mohon bantuannya gan..
<?php
$conn = new mysqli('localhost', 'root', '');
mysqli_select_db($conn, 'employeedb');
if (isset($_GET['username']) && $_GET['username'] != '' &&
isset($_GET['password']) && $_GET['password'] != '')
{
$email = $_GET['username'];
$password = $_GET['password'];
$getData = "SELECT 'ur_Id','ur_username','ur_password' FROM 'tbl_user' WHERE 'ur_username'='" .$email."'
and 'ur_password'='".$password."'";
$result = mysqli_query($conn,$getData);
$userId="";
while($r=mysqli_fetch_row($result)) //bagian yang salah
{
$userId=$r[0];
}
if ($result && $result->num_rows > 0 ){
$resp["status"] = "1";
$resp["userid"] = $userId;
$resp["message"] = "Login successfully";
}
else{
$resp["status"] = "-2";
$resp["message"] = "Enter correct username or password";
}
}
else
{
$resp["status"] = "-2";
$resp["message"] = "Enter Correct username.";
}
@mysqli_close($conn);
?>
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban