PHP Function Error
<p>I am hoping someone can help me, i have an error </p>

<blockquote>
  <p><strong>Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\phpacd\func\user.func.php on line 17</strong></p>
</blockquote>

<p>The line it refers to is <strong><code>$query_reult = mysql_fetch_assoc($query)</code></strong>. The code is from a tutorial, i have gone through the tutorial over and over and i cannot spot the problem! Would love if some one can point me in the right direction?</p>

<pre><code>function login_check($email, $password) {
  $email = mysql_real_escape_string($email);
  $login_query = mysql_query("SELECT COUNT(`user_id`) as `count`, `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;
}

function user_data() {
      $args = func_get_args();
      $fields = '`'.implode('`, `' , $args).'`';

  $query = mysql_query("SELECT $fields FROM `users` WHERE `user_id` =".$_SESSION['user_id']);
  $query_result = mysql_fetch_assoc($query);
  foreach ($args as $field){
    $args[$field] = $query_result[$field];
  }
  return $args;
}
</code></pre>
