สอบถาม Warning Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result
โพสต์แล้ว: 10/06/2021 11:13 am
พอเปิด page ให้แสดงเลขท้าย มันขึ้นแบบนี้ค่ะ
โค้ด: เลือกทั้งหมด
Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\joomla\tools\tools_calculate_payment\index.php on line 58
Fatal error: Uncaught Exception: Pagination::total must be set. in C:\xampp\htdocs\joomla\tools\PHP-Pagination-master\Pagination.class.php:113 Stack trace: #0 C:\xampp\htdocs\joomla\tools\PHP-Pagination-master\Pagination.class.php(281): Pagination->_check() #1 C:\xampp\htdocs\joomla\tools\tools_calculate_payment\index.php(61): Pagination->parse() #2 {main} thrown in C:\xampp\htdocs\joomla\tools\PHP-Pagination-master\Pagination.class.php on line 113
โค้ด: เลือกทั้งหมด
<?php
include '../PHP-Pagination-master/Pagination.class.php';
$page = 1;
if(isset($_GET['page'])){
$page = $_GET['page'];
}
$row = 10;
$total_data = "SELECT COUNT(id) FROM $data";
$result_1 = mysqli_query($conn, $total_data);
$total = mysqli_fetch_row($result_1);
$total_data = $total[0];
$Pagination = new Pagination($page,$total_data);
$Pagination->parse();
$start = ($page - 1)* $row;
?>
โค้ด: เลือกทั้งหมด
<div class="text-center">
<nav aria-label="page navigation">
<?php echo $Pagination->parse(); ?>
</nav>
</div>