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

PHP adodb paging implementation code_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:47:00
Original
960 people have browsed it

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 of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template