I am setting up a web server with sql database been watching a video on it everything looked like it was working up until this issues
<?php
function user_exists($username) {
$username = sanitize($username);
$con = mysqli_connect('localhost', 'root', '');
$query = mysqli_query("SELECT COUNT (`id`) FROM users WHERE username = '$con,$username'");
return (mysqli_result($query, 0) == 1) ? true : false;
}
?>
Recoverable fatal error:
Object of class mysqli could not be converted to string in C:\xampp\htdocs\login\core\functions\users.php on line 5
Note:- I have taken reference from this Video, but i have changed mysql_* to mysqli_* [https://www.youtube.com/watch?v=Til3oVNlho4]