title: mysql_query() always returns True despite entering False information
body: <p>There is code to check if the user has entered the right password or not. </p>
  
  <pre><code>if (isset($_POST['userpassword']))
  {
      include('db.php');
      //I have used the name passwordu instead of password in the database as well.
      $query = "SELECT * FROM users WHERE username = '".$_REQUEST['username']."' AND passwordu = '".md5($_REQUEST['userpassword'])."';";
      $result = mysql_query($query);
      if ($result){ //THIS IS WHERE I FEEL THE ERROR IS
          echo "Congratulations. You are now Logged in. You will be logged out when the Browser is closed.";
          $_SESSION['logval'] = TRUE; //Sets the User Logged in for the complete session.
      }
      else echo "Sorry, You Entered Wrong Info.";
  }
  </code></pre>
  
  <p>However, even if a wrong password is entered it accepts the log in.</p>
  
  <p>What is wrong here?<br>
  Also, if I am making a conceptual mistake, please tell me the right way to check if the user has entered the right information.</p>