So basically i created a webpage with url:
http://localhost/bbe/alumni/showthread.php?t=19
$limit = 8;
$offset = (isset($_GET["page"]) ? $_GET["page"] - 1 : 0) * $limit;
Then put a comment section (with paging) but my codes for paging is not working
<?php
$total = $dbcon->query("SELECT count(*) FROM comment") or die(mysqli_error());
$fetch = $total->fetch_assoc();
for($x = 0; $x < $fetch["count(*)"] / $limit ; $x ++)
{
$page = $x + 1;
if((isset($_GET["page"]) ? $_GET["page"] : 1) == $page) $page = "<b>".$page."</b>";
echo '<a href="showthread.php?t='.$id.'?page='.($x + 1).'" class="label label-danger">'.$page.'</a> ';
}
?>
after 8 comments there is the page number but when i clicked the link for page 2 nothing happens except for the url is changed to:
http://localhost/bbe/alumni/showthread.php?t=19?page=2
and also if i clicked back to page 1 the url changed to
http://localhost/bbe/alumni/showthread.php?t=19?page=2?page=1
and so on.. why does the link in my paging doesn't work? sorry im new in php and still learning online