How would I go about making a pagination script for this MySQL & PHP query.
if (isset($_GET[\'c\'])) {
$c = $_GET[\'c\'];
}
$query = mysql_query(\"SELEC
Pagiantion, it is working simple and easy
query($sql);
$row = mysqli_fetch_row($rs_result);
$total_records = $row[0];
echo $total_records;
$previous = 1;
$total_pages = ceil($total_records / $limit);
$next = $_GET["page"] + 1;
$previous = $_GET["page"] - 1;
$pagLink = "";
if($previous ==0)
{
$prev = "Previous";
}
else
{
$prev = "Previous";
};
echo $prev;
"";
?>
Get all data from database.
$limit = 1;
if (isset($_GET["page"]))
{
$page = $_GET["page"];
}
else
{
$page=1;
}
$start_from = ($page-1) * $limit;
$sql = "SELECT * FROM contact_info ORDER BY id desc LIMIT $start_from , $limit";