I am using Mysqli to discover is a user has activated their account and am trying to use this code.
[php]<?php
function user_exists($username) {
$username = sanitize($username);
$query = "SELECT COUNT(user_id
) FROM users
WHERE username
= $username
";
return (mysqli_query($query, 0) == 1) ? true : false;
}
?>[/php]
When I open the login page I get an error:
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\htdocs\cms\core\functions\users.php on line 5
Being new to mysql / mysqli any help to solve this matter will be appreciated.
Thanks in advanced