My problem being this:
<?php
function user_exists($username) {
$username = sanitize($username);
return (mysql_result(mysql_query("SELECT_COUNT('user_id') FROM `user` WHERE `username` = '$username'"), 0) == 1) ? true : false;
}
?>
As you can see I have included my database name which IS correct and the user DOES exist and this is where I am calling it to pull from sql:
<?php
include 'core/init.php';
if (user_exists('dan') === true) {
echo 'exists';
}
die();
if (empty($_POST) === false) {
$username = $_POST['username'];
$password = $_POST['password'];
if(empty($username) === true || empty($password) === true {
$errors[] = 'You need to enter a username and password';
} else if (user_exists($username) === false) {
$errors[] = 'Sorry this user does not exist';
}
}
?>
I am not sure why I am getting a blank page and it isn's showing the message to say the user exists?