Prompt me & lt ;? Phpwhile ($ myrowmysql_fetch_array ($ result) {an error occurred, but I don't know what is wrong here? How can this problem be solved? Php + mysql
Untitled Document
Include ("conn/conn. php"); // contains the conn. php file
If (isset ($ _ GET ['Page']) {
$ Page = $ _ GET ['Page'];
} Else {
$ Page = 1;
}?>
If ($ page ){
$ Page_size = 4; // Four records are displayed on each page
$ Query = "select * from tb_news"; // defines the query statement.
$ Result = mysql_query ($ query); // execute the query operation
$ Message_count = mysql_num_rows ($ result); // obtain the total number of queries.
$ Page_count = ceil ($ message_count/$ page_size); // obtain the total number of pages
$ Offset = ($ page-1) * $ page_size;
$ Query = "select * from tb_user where id order by id desc limit $ offset, $ page_size ";
$ Result = mysql_query ($ query );
}
?>
Reply to discussion (solution)
Could you please answer... Why does this happen?
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource in E: \ wamp \ www \ wuliupeisong \ admin \ edit_news.php on line 41
$ Query = "select * from tb_user where id order by id desc limit $ offset, $ page_size"; // Is there a problem in the highlighted red?
Thank you very much.
$ Query = "select * from tb_user where id order by id desc limit $ offset, $ page_size"; // Is there a problem in the highlighted red?
Thank you very much for solving the problem.