We have following data in our database.
Let's create a PHP file to view it on our webpage
database.php
<h1>List of Contact</h1>
<table border="2">
<tr>
<th>Id</th>
<th>Email</th>
<th>Username</th>
<th>Password</th>
</tr>
<?php
include 'config.php';
$sql = "SELECT * FROM names";
$result = mysqli_query($conn, $sql);
if ($result) {
while($row = mysqli_fetch_assoc($result)){
$id = $row['id']; // first column of database table
$email = $row['email']; // second column database table
$username = $row['username']; // third column database table
$password = $row['password']; // fourth column database table
?>
<tr>
<td><?php echo $id ?></td>
<td><?php echo $email ?></td>
<td><?php echo $username ?></td>
<td><?php echo $password ?></td>
</tr>
<?php
}
}
?>
</table>
Output :
PHP:
PHP is a server-side programming language used to create dynamic web pages and static sites. It is trendy for the beck-end due to many built-in tools and modules for developing various applications. It is open source and licensed. Website development in PHP is available for both experienced developers and beginners. PHP is a simple language. You can make your blog in just two to three weeks of learning. Plus, on a freelance, it is more in demand.
MySQL:
0 Comments