Home  >  Article  >  Backend Development  >  PHP adodb paging implementation code_PHP tutorial

PHP adodb paging implementation code_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:47:00785browse

Copy code The code is as follows:

include("adodb/adodb.inc.php"); /Include the adodb class library file
include("adodb/adodb-pager.inc.php"); //Include the adodb-pager class library file
$conn = NewADOConnection('mysql'); //Create adodb Object, declares that the database type is MySQL
$conn->Connect("localhost", "root", "1981427", "test"); //Connect to the database, where mydb is the database name
$sql = "select * from tablename1"; //Define the SQL statement to be executed

$pager = new ADODB_Pager($conn, $sql); //Create a paging object based on the connection object and SQL statement
$pager ->Render(3); //Output paginated pages, 3 records per page
?>



Copy the code The code is as follows:

include("adodb/adodb.inc.php"); //Include adodb class library file
include("adodb/adodb-pager.inc.php"); //Include the adodb-pager class library file
$conn = NewADOConnection('mysql'); //Create an adodb object and declare the database type to be MySQL
$conn->Connect("localhost", "root", "1981427", "test"); //Connect to 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 be executed

$pager = new ADODB_Pager($conn, $sql); //Create based on the connection object and SQL statement Paging object
$pager->Render(2); //Output the paging page, 2 records per page
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320048.htmlTechArticleCopy the code as follows: ?php include("adodb/adodb.inc.php"); //Include adodb Class library file include("adodb/adodb-pager.inc.php"); //Include adodb-pager class library file $conn = NewADOConnec...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn