include"db.php";
$searchCriteria ="";
if($_GET['q']=="Fact" or $_GET['q']=="Entertainment" or $_GET['q']=="Video" or $_GET['q']=="Game" ){
$searchCriteria = " where tag='".$_GET['q']."'";
}
$sql = mysqli_query($conn,"select * from posts $searchCriteria");
$total = mysqli_num_rows($sql);
$adjacents = 3;
$targetpage = "index.php"; //your file name
$limit = 10; //how many items to show per page
$page = $_GET['page'];
if($page){
$start = ($page - 1) * $limit; //first item to display on this page
}else{
$start = 0;
}
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is current page - 1
$next = $page + 1; //next page is current page + 1
$lastpage = ceil($total/$limit); //lastpage.
$lpm1 = $lastpage - 1; //last page minus 1
/* CREATE THE PAGINATION */
$pagination = "";
if($lastpage > 1)
{
$pagination .= "\n";
}
?>
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined array key "q" in /home/televisions123/public_html/aoneappz.com/posts.php on line 6
Warning: Undefined variable $start in /home/televisions123/public_html/aoneappz.com/posts.php on line 9
Warning: Undefined variable $limit in /home/televisions123/public_html/aoneappz.com/posts.php on line 9
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 in /home/televisions123/public_html/aoneappz.com/posts.php:10
Stack trace:
#0 /home/televisions123/public_html/aoneappz.com/posts.php(10): mysqli_query()
#1 /home/televisions123/public_html/aoneappz.com/index.php(54): include('/home/televisio...')
#2 {main}
thrown in /home/televisions123/public_html/aoneappz.com/posts.php on line 10