This article mainly introduces the code for implementing the simple page Jump function written in php. If you need it, refer to it.
This article mainly introduces the code for implementing the simple page Jump function written in php. If you need it, refer to it.
Not to mention, directly add the code
The Code is as follows:
// Query the connected database
Mysql_connect ('localhost', 'username', 'userpwd') or die ("database connection failed". mysql_error ());
Mysql_select_db ('database name ');
Mysql_query ('set names utf8 ');
$ Sql1 = "select * from user ";
$ Query1 = mysql_query ($ sql1 );
$ Count = array ();
While ($ row = mysql_fetch_assoc ($ query1 )){
$ Count [] = $ row;
}
$ Totalnews = count ($ count );
// Determine the page
If ($ _ GET ['page']) {
$ Page = $ _ GET ['page'];
} Else {
$ Page = 1;
}
$ Start = ($ page-1) * $ newnum;
$ SQL = "select * from user limit $ start, $ newnum ";
$ Query = mysql_query ($ SQL );
$ Ret = array ();
While ($ row = mysql_fetch_assoc ($ query )){
$ Ret [] = $ row;
}
?>
// Table Style
$ Value) {?>
Delete | modify
// Page Jump
Homepage> Previous Page / "> Next page"> last page
,