PHP ADODB pagination Implementation Code _php Foundation

Source: Internet
Author: User
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
? >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.