php - mysqli_data_seek Function Returns Username Result, When Username Not in Database -
I have a function in which a named user is in my database, I have a message on my screen string value , Which just says my function works. However, when I do not exist in the database, the name changes, I still get a string output that says that the function works. So I am trying to figure out how my argument in question has been messed up. What do I have: users.php file: & lt; Php function user_exists ($ user name) {$ db = "adult"; $ DbH = "localhost"; $ DbU = "root"; $ DbP = "Jeffrey 9"; // $ dbCon = mysqli_connect ($ dbH, $ dbU, $ dbp, $ db) connection to; $ Username = sanitize ($ username); // $ query = mysqli_query ($ dbCon, "SELECT COUNT (` user_id`) WHERE 'user name' = '$ user name' from `users`); return (mysqli_data_seek (mysqli_query ($ dbCon," SELECT COUNT (`user_id `) WHERE 'username' = '$ user name' from` users`), 0) == 1)? right wrong; }? & Gt; Now here is the login pa...