Zee Web 2 Lab 2
Zee Web 2 Lab 2
LANGUAGES
Web lab # 2
Web Engineering II
Submitted to:
Ma’am Huma Nadeem
Submitted by
M.Zeeshan Hassan (11786)
Database Connection:
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "idata";
// Create connection
>connect_error);
// Connected successfully
?>
Index:
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body>
<body>
<div class="container">
<br />
<br />
</div>
<div id="load_data"></div>
<div id="load_data_message"></div>
<script>
$(document).ready(function()
load_data(limit, start) {
$.ajax({ url:
"fetch.php",
method: "POST",
data: { limit:
limit, start:
start
},
function(data) {
$('#load_data_message').html("<center><img
src='https://flevix.com/wpcontent/uploads/2019/07/Ball-Drop-Preloader-1-1.gif' /></center>");
action = "inactive";
} else {
$("#loader").hide();
Found</button>");
action = 'active';
});
= 'active'; load_data(limit,
start);
load_data(limit, start);
}, 1000);
});
});
</script>
</body>
Fetch:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div> <?php
include("databaseConnection.php"); if
(isset($_POST["limit"], $_POST["start"])) {
$query = "SELECT * FROM lab2 LIMIT " . $_POST["start"] . ", " .$_POST["limit"] .
"";
"<h2>",$row['id'], "</h2>
?>
</div>
</body>
</html>