Eu tenho um problema com o meu código PHP. Estou tentando criar um sistema de login no entanto quando eu executo o login eu recebo esse erro
Catchable fatal error: Object of class mysqli could not be converted to string in /var/www/html/ASSETS/PHP/functions.php on line 15
Alguém pode ajudar?
Meu arquivo 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;
}
}
?>