Page 4 of phpajax. Ajax pagination phpaajax pagination javaajax pagination asp. netaajax pagination jqueryajax pagination jspajax no-refreshing pagination aspaajax pagination problem ajax implementation pagination ajaxjsp pagination is the most p ajax pagination php ajax pagination java ajax pagination asp.net ajax pagination jquery ajax pagination jsp ajax No-refreshing pagination asp ajax pagination ajax implement pagination ajax jsp pagination
The result. php file is the most ,:
// A series of queries made from the database will not be mentioned here... you can refer to the following for your reference.
// PHP Server
/*
PHP paging functions
Function Ajaxpage ($ SQL, $ num ){
Global $ db;
$ Pageno = $ _ GET ['pageno'];
$ Pageno = (int) $ pageno;
If (empty ($ pageno) | $ pageno <1) $ pageno = 1;
$ Result = $ db-> query ($ SQL );
$ Number = $ db-> num_rows ($ result );
$ Totalpage = (int) ceil ($ number/$ num );
If ($ pageno >=$ totalpage) {$ pageno = $ totalpage ;}
$ Start_rowno = ($ pageno-1) * $ num;
$ Query = $ SQL. "LIMIT". $ start_rowno. ",". $ num;
$ Result = $ db-> query ($ query );
Return array ('result' => $ result, 'page' => array ('pageno' => $ pageno, 'totalpage' => $ totalpage, 'number' => $ number ));
}
$ SQL = "select * from guest"; // query SQL statements
$ Num = 2; // control by page. two records are displayed on each page.
$ Return = Ajaxpage ($ SQL, $ num );
While ($ row = $ db-> fetch_assoc ($ return ['result']) {
$ Result [] = $ row; // you can use PHP to process data here.
}
$ Result = array ('result' => $ result, 'page' => $ return ['Page']);
Include ('json. class. php'); // contains json files
$ Json = & new Json ();
$ Result = $ json-> encode ($ result); // JSON
Echo $ result;
*/
// Assume that the resource obtained from the database through the pageno parameter sent by AJAX is in the format of $ str after JSON, and the output is directly processed by JS.
// If you have any questions, ask me.
If (ob_get_length () ob_clean ();
Header ('cache-control: no-cache, must-revalidate ');
Header ('pragma: no-cache ');
If ($ _ GET ['pageno'] = 1)
$ Str = '{"result": [{"id": "99", "name": "Technology", "qq": "", "tel ": "", "email": "", "content": "[emot: 0]", "time": "1198522490", "ip": "127.0.0.1 ",
"Rcontent": null, "rtime": "0", "url": "0", "img": "app/index/image/show/1.gif "}, {"id": "100", "name": "test", "qq": "", "tel": "", "email ":"", "content": "[emot: 9]", "time": 1198548687 "," ip ":" 127.0.0.1 ","
Rcontent ": null," rtime ":" 0 "," url ":" 0 "," img ":" app/index/image/show/4.gif"}], "page": {"pageno": 1, "totalpage": 2, "number": 2 }}';
Else
$ Str = '{"result": [{"id": "101", "name": "ah", "qq": "", "tel ": "", "email": "", "content": "[emot: 8] [emot: 1]", "time": "1198548716", "ip ": "127.0.0.1", "rcontent": null, "rtime": "0", "url": "0", "img ":
"App/index/image/show/9.gif"}]," page ": {" pageno ": 2," totalpage ": 2," number ": 3 }}';
Echo iconv ('gb2312', 'utf-8', $ str );
?>
Php ajax pagination java ajax pagination asp.net ajax pagination jquery ajax pagination jsp ajax without refreshing pagination asp ajax pagination problem ajax implementation pagination ajax jsp pagination is the most p...