title: mysql_result(): supplied argument is not a valid MySQL result resource error?
body: <p>Creating a login system for something and am getting:</p>
  
  <blockquote>
    <p>Warning: mysql_result(): supplied argument is not a valid MySQL result resource in .../func/user.func.php on line 21</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>function user_register($email, $name, $password) {
  
  }
  
  function user_exists($email) {
    $email = mysql_real_escape_string($email);
    $query = mysql_query("SELECT COUNT('user_id') FROM 'users' WHERE 'email' ='$email'");
  
    //this is line 21:
    return (mysql_result($query, 0) == 1) ? true : false;
  }
  </code></pre>