title: PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
body: <p>I'm getting warning: </p>
  
  <blockquote>
    <p>mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;?php
  
      session_start(); 
      $db=mysqli_connect("localhost","aaron","","demo");
      $id=$_GET["id"];
      $sql=mysqli_query($db,"SELECT * FROM usres");
      $check=mysqli_fetch_array($db,$sql);
      if(isset($_POST['update'])){    
          $id=$_POST['id'];
          $name=$_POST['name'];
          $email=$_POST['email'];
          $password=$_POST['password'];
          $bankbookno=$_POST['bankbookno'];
          $adharno=$_POST['adharno'];
          $pancard=$_POST['pancard'];
          $result = mysqli_query($db, "UPDATE users SET name='$name',email='$email',password='$password',bankbookno='$bankbookno' ,adharno='$adharno',pancard='$pancard'WHERE id=$id");
          header("location:view.php");
      }
  ?&gt;
  </code></pre>