View Data Using PHP Mysqli
<?php
$con=mysqli_connect("localhost","root","root","example") or die(mysqli_error());
$query = mysqli_query($con, "select * from student_info");
if(mysqli_num_rows($query)>0)
{
?>
<table border="1" align="center">
<thead>
<tr>
<th><div align="center">id</div></th>
<th><div align="center">name</div></th>
<th><div align="center">E-Mail</th></div>
<th><div align="center">Address</th></div>
<th><div align="center">Mobile</th></div>
<th><div align="center" style="width:110px">Action</th></div>
</tr>
</thead>
<tbody>
<?php
while($result=mysqli_fetch_assoc($query))
{
extract($result);
?>
<tr>
<td align="center"><?php echo $id?></td>
<td align="center"><?php echo $name?></td>
<td align="center"><?php echo $email?></td>
<td align="center"><?php echo $address?></td>
<td align="center"><?php echo $m_no?></td>
<td class="center">
<a href="view111.php?id=<?=$id?>"><input type="button" value="view" />
</a>
<a href="update.php?id=<?=$id?>"><input type="button" value="update" />
</a>
<a href="delete.php?id=<?=$id?>"><input type="button" value="delete" />
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
$con=mysqli_connect("localhost","root","root","example") or die(mysqli_error());
$query = mysqli_query($con, "select * from student_info");
if(mysqli_num_rows($query)>0)
{
?>
<table border="1" align="center">
<thead>
<tr>
<th><div align="center">id</div></th>
<th><div align="center">name</div></th>
<th><div align="center">E-Mail</th></div>
<th><div align="center">Address</th></div>
<th><div align="center">Mobile</th></div>
<th><div align="center" style="width:110px">Action</th></div>
</tr>
</thead>
<tbody>
<?php
while($result=mysqli_fetch_assoc($query))
{
extract($result);
?>
<tr>
<td align="center"><?php echo $id?></td>
<td align="center"><?php echo $name?></td>
<td align="center"><?php echo $email?></td>
<td align="center"><?php echo $address?></td>
<td align="center"><?php echo $m_no?></td>
<td class="center">
<a href="view111.php?id=<?=$id?>"><input type="button" value="view" />
</a>
<a href="update.php?id=<?=$id?>"><input type="button" value="update" />
</a>
<a href="delete.php?id=<?=$id?>"><input type="button" value="delete" />
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
Comments
Post a Comment