Copy Code code as follows:
<?php
Include ("adodb/adodb.inc.php"); Contains ADODB class library files
Include ("adodb/adodb-pager.inc.php"); Contains Adodb-pager class library files
$conn = newadoconnection (' mysql '); Create a ADODB object declaring that the database type is MySQL
$conn->connect ("localhost", "root", "1981427", "Test"); Connect the database, where MyDB is the database name
$sql = "SELECT * from tablename1"; Define the SQL statement to execute
$pager = new Adodb_pager ($conn, $sql); Create a paging object based on connection objects and SQL statements
$pager->render (3); Output paging page, 3 records per page
?>
Copy Code code as follows:
<?php
include ("adodb/adodb.inc.php");///Contains ADODB class library file
include (" Adodb/adodb-pager.inc.php "); Contains the Adodb-pager class library file
$conn = newadoconnection (' mysql ');//Create ADODB object, declare database type as MySQL
$conn->connect (" LocalHost "," root "," 1981427 "," Test "); Connect the database, where MyDB is the database name
$sql = "SELECT ID as ' number ', username as ' name ', password as ' password ' from tablename1";//define the SQL statement to execute
$pager = new Adodb_pager ($conn, $sql);//Create a paging object based on connection objects and SQL statements
$pager->render (2);//Output Paging page, 2 records per page
? >