title: mysqli_fetch_row() expects parameter 1 to be mysqli_result
body: <p>I have read a lot of these and they are for the most part and error in the database connection or the query.   I am getting this error and I have a good connection and a good query.   I know this because I print_r or echo the results of the $row and I get matching results.  </p>
  
  <pre><code>&lt;?php 
  if (!isset($_POST['submit'])) {
      header("Location: http://tsec.tleeaa.org"); 
      exit;   
  }
  ?&gt;
  &lt;?php 
  session_start();
  require_once('Connections/db_tsectleeaa_connection.php');
  require_once("_includes/functions.php"); 
  ?&gt;
  &lt;?php $_SESSION['leadadv_email'] = $_POST['leadadv_email']; $email_compare =    $_SESSION['leadadv_email']; ?&gt;
  &lt;?php
  $dbquery  = "SELECT * ";
  $dbquery .= "FROM `tsec_team_registration` "; 
  $dbquery .= "WHERE `leadadv_email` = ";
  $dbquery .= " '$email_compare' " ;
  
  $result = mysqli_query($db_tsectleeaa_connection, $dbquery);
      if(!isset($result)) {
          die("Database query failed");
      }
  
  while ($row = mysqli_fetch_row($result)){
  print_r($row[10]);                  //should match next line
  echo "&lt;br /&gt;".$email_compare."&lt;br /&gt;";          //should match line above
      if ($row[10] === $email_compare){
          echo "match!";
  
          } else echo "no match!";
  } 
  ?&gt;
  </code></pre>
  
  <p>the big problem is that the IF statement doesn't work.  It will work when the statement is true but will not to to 'else' if it is false.</p>
  
  <p>What this page does is verify against an email put in the previous page.  Once they hit 'submit' the action for the form is this page.  When the database has bacon@burger in the correct place and the user uses bacon@burger for the email address, the following result happens:
  bacon@burger
  bacon@burger
  match!</p>
  
  <p>I am still getting this error:</p>
  
  <pre><code>( ! ) Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\index_action.php on line 24
  Call Stack
  #   Time    Memory  Function    Location
  1   0.0005  256032  {main}( )   ..\index_action.php:0
  2   0.0052  273264  mysqli_fetch_row ( )    ..\index_action.php:24
  </code></pre>
  
  <p>can anyone point me in the direction of what might be going on, please?</p>