title: How can I make attemp_login() function in php with mysql?
body: <p><b>WHAT I HAVE: </b><br>
  I have this function called <code>get_name()</code> that returns the name of the user from database if excisting username and passwords are provided in the parametres of it and it works perfectly. CODE:  </p>
  
  <pre><code>function get_name($theusername, $thepassword){
      $host = 'localhost';
      $username = 'root';
      $password = '';
      $database = 'website';
      $con = mysqli_connect($host, $username, $password, $database);
  
      $theusername = mysqli_real_escape_string($con, $theusername);
      $thepassword = mysqli_real_escape_string($con, $thepassword);
      $thepassword = md5($thepassword);
  
      $query = "SELECT * FROM members WHERE username = '{$theusername}' AND password = '{$thepassword}'";
  
      $result = mysqli_query($con, $query);
  
      $row = mysqli_fetch_array($result);
  
      return $row['name'];
  
      mysqli_close($con);
  }
  </code></pre>
  
  <p><b>WHAT I WANT: </b><br>
  I want to make a function called <code>attempt_login()</code> that should return <code>true</code> if the username AND password is correct else it should return <code>false</code>.<br>
  <a href="http://rabwahnetwork.net/wp-content/uploads/2014/03/image1.png" rel="nofollow">DATABASE SCREENSHOT</a><br>
  CAN ANYONE DO THIS FOR ME? </p>