Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

Mysql WHERE Clause

by
Category:mysql
php mysql
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 a selection criteria to select the required records from a table.

First you can need database connection in php

Code

<table>
  <thead>
    <tr>
      <th>Email</th>
      <th>Password</th>
      <th>Mobile</th>
      <th>Date</th>
    </tr>
  </thead>

  <tbody>
      <?php
      $sql = "SELECT * FROM users WHERE user_type = '1' "; 
      $result = mysqli_query($con,$sql);
      while($row = mysqli_fetch_assoc($result))
      {
      ?>
      <tr>
            <td><?=$row['email']?></td>
            <td><?=$row['password']?></td>
            <td><?=$row['mobile']?></td>
            <td><?=$row['create_date']?></td>
      </tr>
    <?php
      }
    ?>
  </tbody>
</table>


0 Comments


Html code work in comment box


Related Post