how to fetch data in the database using php with mysqli

Hey guys, Today we are learning MYSQLI FETCH QUERY execute in the database using PHP with MYSQLI.

Originally published at - 17 Mar 2019 05:50 pm

1. HTML Source Code(Index.php)

<table border="1" cellspacing="10">


<th>S. N.</th>


<th>Email Id</th>




$conn=mysqli_connect("localhost", "root", "", "testproject");

$query=mysqli_query($conn, "SELECT * FROM userdetails"); while($rows=mysqli_fetch_array($query)){



<td><?php echo $rows['id']; ?></td>

<td><?php echo $rows['name']; ?></td>

<td><?php echo $rows['email']; ?></td>

<td><a href="delete.php?id=<?php echo $rows['id']; ?>">Delete</a></td>


<?php } ?>