title: Joshcam PHP MySQLi Database Class SELECT query
body: <p>I'm using the Joshcam <a href="https://github.com/joshcam/PHP-MySQLi-Database-Class/blob/master/MysqliDb.php" rel="nofollow noreferrer">MysqliDb</a> to manage the database. I've successfully created a query to insert the data and i can query the database to fetch the results using this snippet that i've found in the documentation. </p>
  
  <pre><code>$cols = Array ("id", "name", "email");
  $inviteMail = $db-&gt;get ("invitation", null, $cols);
  if ($db-&gt;count &gt; 0)
  foreach ($inviteMail as $Mail) { 
      print_r ($Mail);
  }
  </code></pre>
  
  <p>How i can verify if an user posted value is already present in the database table? With this query i can read all data of the table, and i don't wanna this, i'm reading the documentation on github (This is the first time i use this class) but for now i can't find a valid solution, so i try with this code i've written, but it give me the error that i've echoed also with different emails</p>
  
  <pre><code>$cols = Array ("id", "email", "token", "code");
  $inviteMail = $db-&gt;get ("invitation", null, $cols);
  if ($db-&gt;count &gt; 0)
  foreach ($inviteMail as $Mail) { 
      if($_POST[email] == $Mail){
  echo 'email address already used.';
  }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've modified the code using the suggested snippet but it give me an error. I've looked at the documentation and i've modified the code in this way.. </p>
  
  <pre><code>$cols = Array ("email");
  $inviteMail = 
  $db-&gt;where('email', $_POST['invitation_email']);
  $results = $db-&gt;get("invitation", null, $cols);
  if ($results == $_POST['invitation_email']) {
  echo 'email address already used.';
  }
  </code></pre>
  
  <p>Now no error is logged but if i try with an already saved email address, the script don't check for the results. What i'm doing wrong? </p>