title: if statement based on two variables matching a row in database
body: <p>I am having a little trouble thinking of how to write the condition for the if statement of the following. So I have a database with two columns: ID and Username.   I would like to write an if else statement that compares both variables $ID and $Username with the rows of the database.  If it matches I want the statement to die and if it doesn't match i want to }else{ some other code.  So I am thinking it would be something like this:</p>
  
  <pre><code>$ID = 5;
  $Username = 'Butterdog';
  $result = mysqli_query($con,"SELECT * FROM database");
  while($row = mysqli_fetch_array($result))
  {  
   if  $ID and $Username both match any row in the database { die
   }else{ do some other code }};
  </code></pre>
  
  <p>So I am just having trouble thinking of how to write the condition that compares BOTH variables to each  row in the database.  I know this must be elementary but I just haven't come across it yet and my searching has come up null.   </p>