Paging | Show class.php:
?
/*
-----------------------------------------------------------------------------------------------
Name: Turnpage
Function: Pagination display
member functions:
Entrance (): The entry of the class, parameter is the parameter of all member functions
Selectdata ($connection, $query): A function that selects data, returns an array
ShowData ($array, $i, $j): A function that displays the values of each field, returns a value
Maketable ($array, $intPageBegin, $intPageEnd): The function that generates the table, generates the corresponding table according to the number of fields to be displayed, the parameters are: array, the information ordinal of the beginning of each page, the information ordinal of the end of each page
Makelink ($parameter =null): The link to the page is displayed, and the parameters are optional
GetFileName (): Remove the name of the current execution file, return the file name
The relationship between functions:
-----------------------------------------------------------------------------------------------
*/
Class Turnpage
{
var $strArray;
var $cols;
var $rows;
var $strFieldName;
var $intPageBegin;
var $intPageEnd;
function entrance ($connection, $query)
{
$myArray = $this->selectdata ($connection, $query);
}
?>
test.php:
?
Include (".. /common/connection.php "); Connecting to database operations
Include (".. /common/class.php "); Include the above file in the recent
$query = "SELECT * from Uphoto ORDER by intuid ASC";
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