<?php
session_start();
header("Content-type:text/html;charset=utf-8"); //Set encoding
$page=isset($_GET['page']) ?$_GET['page'] :1 ;//Receive page number
$page=!empty($page) ?$page :1 ;
$F=$_GET['F'];
// Create connection
$conn = mysqli_connect("localhost", "root", "", "mybbs");
mysqli_set_charset($conn,'utf8'); //Set the character set
$table_name="tiopic";//Get the table name setting
$perpage=5;//Number of data displayed on each page
//Maximum number of pages and total number of records
$total_sql="select count(*) from $table_name ";
$total_result =mysqli_query($conn,$total_sql);
$total_row=mysqli_fetch_row($total_result);
$total = $total_row[0]; //Get the maximum page number
$total_page = ceil($total/$perpage);//Upward integer
//Critical point
$page=$page> $total_page ? $total_page:$page;//What happens when the next page number is greater than the maximum number of pages
//Paging setting initialization
$start=($page-1)*$ perpage;
$sql="select * from tiopic order by id desc limit $start ,$perpage";
$query=mysqli_query($conn,$sql);
$sum=mysqli_num_rows($query);
?>
It is estimated that either the function in line 24 is not supported, or there is a problem with the parameters passed in by 24.
First run your sql statement in the database to see if there is any result, and then dump the result of $query. This is a warning, not a fatal error. $sum should be the number of rows returned. You can output it to see look
You have to read this error message. This error message reminds you that the mysqli_num_rows() method expects the boolean value of mysqli_result to be 1, which is on line 24 of the D:\XXX path\forums.php file