Hejka Naklejka ! Mam mały problemik, dużo grzebałem ale nie potrafię znaleźć rozwiązania. Mam nadzieję że ktoś pomoże <3
<?php
if(!isset($_POST['login'])){
header('Location: sign_in.php');
exit();
}
include("./connection.php");
$login = htmlentities(mysqli_real_escape_string($connect, $_POST['login']));
$password = htmlentities(mysqli_real_escape_string($connect, $_POST['password' ]));
$findUser = "select * from users where user_login='$login' AND user_pass='$password'";
$query = mysqli_query($connect, $findUser);
$checkUser = mysqli_num_rows($query);
if($checkUser == 1){
$_SESSION['isLogged'] = true;
$line = $checkUser->fetch_assoc();
$_SESSION['user_name'] = $line['user_name'];
$_SESSION['c#_Tests'] = $line['c#_Tests'];
$_SESSION['Web_Tests'] = $line['Web_Tests'];
$_SESSION['Arduino_Tests'] = $line['Arduino_Tests'];
$_SESSION['Unity_Tests'] = $line['Unity_Tests'];
}else{
$_SESSION['error'] = "<span>Sprawdź pasy zią :{D </span>";
header('Location: sign_in.php');
}
?>
BŁĄD:
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on int in D:\xampp\htdocs\Blog_zaprogreamowani\findUser.php:19 Stack trace: #0 {main} thrown in D:\xampp\htdocs\Blog_zaprogreamowani\findUser.php on line 19