adb php adodb paging implementation code

WBOY
Release: 2016-07-29 08:39:39
Original
1078 people have browsed it

Copy the code The code is as follows:


include("adodb/adodb.inc.php"); //Include the adodb class library file
include("adodb/adodb-pager.inc. php"); //Contains adodb-pager class library file
$conn = NewADOConnection('mysql'); //Create 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 * from tablename1"; //Define the SQL statement to be executed
$pager = new ADODB_Pager($conn, $ sql); //Create paging objects based on connection objects and SQL statements
$pager->Render(3); //Output paging pages, 3 records per page
?>


Copy code The code is as follows:


include("adodb/adodb.inc.php"); //Includes the adodb class library file
include("adodb/adodb-pager.inc.php"); // Contains 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 a paging object based on the connection object and SQL statement
$pager->Render(2); //Output the paging page, 2 records per page
?> ;

The above introduces the adb php adodb paging implementation code, including adb content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
adb
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template