php³¬¼¶·ÖÒ³Àà(תÔØ×Ôphp100ÂÛ̳)(2)
Õâ¸öÀà½ö½ö´¦ÀíÊý¾Ý£¬²¢²»¸ºÔð´¦ÀíÏÔʾ£¬ÒòΪÎÒ¾õµÃ½«Êý¾ÝµÄ´¦ÀíºÍ½á¹ûµÄÏÔʾ¶¼·Åµ½Ò»¸öÀàÀï±ßʵÔÚÊÇÓÐЩÃãÇ¿¡£ÏÔʾµÄʱºòÇé¿öºÍÒªÇó¶à±ä£¬²»Èç×Ô¼º¸ù¾ÝÀà¸ø³öµÄ½á¹û´¦Àí£¬¸üºÃµÄ·½·¨ÊǸù¾ÝÕâ¸öPagerÀà¼Ì³ÐÒ»¸ö×Ô¼ºµÄ×ÓÀàÀ´ÏÔʾ²»Í¬µÄ·ÖÒ³£¬±ÈÈçÏÔʾÓû§·ÖÒ³Áбí¿ÉÒÔ£º
<?php Class MemberPager extends Pager { function showMemberList() { global $db; $data = $this->getPageData(); // ÏÔʾ½á¹ûµÄ´úÂë // ...... } } /// µ÷Óà if ( isset($_GET['page']) ) { $page = (int)$_GET['page']; } else { $page = 1; } $sql = "select * from members order by id"; $pager_option = array( "sql" => $sql, "PageSize" => 10, "CurrentPageID" => $page ); if ( isset($_GET['numItems']) ) { $pager_option['numItems'] = (int)$_GET['numItems']; } $pager = @new MemberPager($pager_option); $pager->showMemberList(); ?>µÚ¶þ¸öÐèҪ˵Ã÷µÄµØ·½¾ÍÊDz»Í¬Êý¾Ý¿âµÄ¼æÈÝÐÔ£¬ÔÚ²»Í¬µÄÊý¾Ý¿âÀï½Ø»ñÒ»¶Î½á¹ûµÄд·¨ÊDz»Ò»ÑùµÄ¡£
mysql: select * from table limit offset, rows
pgsql: select * from table limit m offset n
......
ËùÒÔÒªÔÚÀàÀï±ß»ñÈ¡½á¹ûµÄʱºòÐèҪʹÓÃpear dbÀàµÄlimitQuery·½·¨¡£
ok£¬Ð´ÍêÊÕ¹¦£¬Ï£Íû»¨Ê±¼ä¿´ÍêÕâЩÎÄ×ÖµÄÄã²»¾õµÃÊÇÀË·ÑÁËʱ¼ä¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ