Source code :-
<html>
<head>
</head>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "tutorial";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT * FROM employees";
$result = $conn->query($sql);
while($row = $result->fetch_assoc())
{
echo "id: " . $row["id"]. " - Name: " . $row["name"]."<br/>";
}
?>
<button onclick="getElementById('page').innerHTML='Dynamic Display'">Click here</button>
<div id="page"></div>
</body>
No comments:
Post a Comment