This article mainly introduces the code for implementing the simple page jump function written in php. if you need it, you can refer to the code below.
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 |