Pages
Date Added |
Page Name |
Page Title |
View |
Edit |
Delete |
' . mysqli_error($con) . '
';
} else {
echo '
Page deleted.
';
}
}
$rec_limit = 20;
$query = "SELECT count(id) FROM pages";
$retval = mysqli_query($con, $query);
$row = mysqli_fetch_array($retval);
$rec_count = Trim($row[0]);
if (isset($_GET['page'])) { // Get the current page
$page = $_GET['page'] + 1;
$offset = $rec_limit * $page;
} else {
// Show first set of results
$page = 0;
$offset = 0;
}
$left_rec = $rec_count - ($page * $rec_limit);
// Set the specific query to display in the table
$sql = "SELECT * FROM pages ORDER BY `id` DESC LIMIT $offset, $rec_limit";
$result = mysqli_query($con, $sql);
$no = 1;
// Loop through each records
while ($row = mysqli_fetch_array($result)) {
// Populate and display results data in each row
echo '
';
echo '' . $row['last_date'] . ' | ';
echo '' . $row['page_name'] . ' | ';
echo '' . $row['page_title'] . ' | ';
$myid = $row['id'];
echo '' . " View " . ' | ';
echo '' . " Edit " . ' | ';
echo '' . " Delete " . ' | ';
$no++;
}
echo '
';
echo '';
echo '
';
// Display the pagination
echo '';
?>