title: User/Admin login in PHP
body: <p>I know there are similar threads, and I have looked at those threads, although none of them seem to work for me.<br>
  First off, I'd like to point out that this is a simple college assignment and is <em>not</em> an actual website, I am <em>not</em> worried about "security" or anything.<br>
  Secondly, my database is made of <code>'username' 'password' and 'admin', admin being 0 or 1</code>.<br>
  What I need help with is to make the user redirect to <code>'hit-counter.php'</code> if the admin value is 1, not 0.<br> Currently, they always go to <code>'index_loginsuccesful.php'</code> no matter the admin value. (Or <code>'index_loginfailed.php'</code> if the username/password is wrong)<br>
  Any thoughts?</p>
  
  <pre><code>&lt;?php
  $conn = mysql_connect ("localhost", "root","");
  mysql_select_db("a_blub",$conn);
  $result=mysql_query("SELECT password FROM user WHERE username = '$_POST[theusername]'",$conn);
  $rows=mysql_fetch_array($result);
  
  if($_POST['thepassword'] == $rows[0])
  {
      if ($_POST['admin'] == 1)
      Header("location:hit-counter.php");
      else
      Header("location:index_loginsuccesful.php");
  }
  else
  {
      Header("location:index_loginfailed.php");
  } ?&gt;
  </code></pre>