title: how to know if admin in PHP mysqli login page
body: <p>i have a php login page and mysql table ( USERS : id,username,password,admin )</p>
  
  <p>the admin column's data type is BIT and the default is 0 , if admin the value of users.admin= 1</p>
  
  <p>so my php code is working perfectly except i dont know how to fetch the admin in my prepared statement because it is not an input like username or password :\</p>
  
  <pre><code>        $username='blabla';
          $password='blabla';
          if ($stmt = $mysqli-&gt;prepare("SELECT * FROM `users` WHERE username=? and password=? LIMIT 1"))
       {
          /* bind parameters for markers */
          $stmt-&gt;bind_param("ss",$username,$password);
          $stmt-&gt;execute();
          $stmt-&gt;bind_result($username,$password);
          $stmt-&gt;store_result();
              if($stmt-&gt;num_rows == 1)  //To check if the row exists
                      {
                          while($stmt-&gt;fetch()) //fetching the contents of the row
  
                            {$_SESSION['username'] = $username;
                            //$_SESSION['admin'] = $admin; (not added yet)
                             echo "1";
                             exit();
                             }
                      }
              else {
                  echo "2";
                  return;
                   }
  
          $stmt-&gt;close();
          $stmt-&gt;free_result();
      }
  
      $mysqli-&gt;close();
  </code></pre>