У меня проблема с моим кодом PHP. Я пытаюсь создать систему входа в систему, однако, когда я выполняю вход в систему, я получаю эту ошибку
Catchable fatal error: Object of class mysqli could not be converted to string in /var/www/html/ASSETS/PHP/functions.php on line 15
Кто-нибудь может помочь?
Мой файл functions.php
?php
function email_exists($email, $con) {
$result = mysqli_query($con, "SELECT id FROM users WHERE email='$email'");
if(mysqli_num_rows($result) == 1) {
return true;
} else {
return false;
}
}
function username_exists($username, $con) {
$result = mysqli_query($con, "SELECT * FROM users WHERE username='$username'");
if(mysqli_num_rows($result) == 1) {
return true;
} else {
return false;
}
}
function logged_in() {
if(isset($_SESSION['username'])) {
return true;
} else {
return false;
}
}
?>
