I have removed this line from query in login_check
COUNT(user_id
) as count
,
I found this query was not running, so your login_check must look like this as below
function login_check($email, $password){
$email = mysql_real_escape_string($email);
$login_query = mysql_query("SELECT `user_id` FROM `users` WHERE `email`='$email' AND `password`='".md5($password)."'");
return (mysql_result($login_query, 0) == 1) ? mysql_result($login_query, 0, 'user_id') : false;
}