Mysql WHERE Clause


We have seen the SQL SELECT command to fetch data from a MySQL table. We can use a conditional clause called the WHERE Clause to filter out the results. Using this WHERE clause, we can specify selection criteria to select the required records from a table.

First, you can need database connection in PHP



      $sql = "SELECT * FROM users WHERE user_type = '1' "; 
      $result = mysqli_query($con,$sql);
      while($row = mysqli_fetch_assoc($result))