当前位置: 首页>>代码示例>>PHP>>正文


PHP paging::get_page_num_rows方法代码示例

本文整理汇总了PHP中paging::get_page_num_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP paging::get_page_num_rows方法的具体用法?PHP paging::get_page_num_rows怎么用?PHP paging::get_page_num_rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paging的用法示例。


在下文中一共展示了paging::get_page_num_rows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: customPaging

function customPaging($sql, $ListRecPerPage = 20, $rewrite_url = false)
{
    //var_dump($rewrite_url);
    global $link;
    //===============Paging========================
    //$ListRecPerPage = 10;
    $pg = new paging($link, "page", $ListRecPerPage, "»", "«", 5, @$CurlLink);
    $pg->sql = $sql;
    $r = $pg->get_page_result();
    // result set
    $num_rows = $pg->get_page_num_rows();
    // number of records in result set
    $data = array();
    if ($num_rows > 0) {
        while ($o = GetArr($r)) {
            array_push($data, $o);
        }
    }
    mysql_data_seek($r, 0);
    //if( @$iscurl )
    //$nav_links = $pg->navigation_curl(" | ", "price" ); // the navigation links (define a CSS class selector for the current link)
    //else $separator = " | ", $css_current = "", $back_forward = false, $rewrite_url = false
    $nav_links = $pg->navigation(" ", "current", false, $rewrite_url);
    // the navigation links (define a CSS class selector for the current link)
    $nav_info = $pg->page_info("to");
    // information about the number of records on page ("to" is the text between the number)
    $simple_nav_links = $pg->back_forward_link();
    // the navigation with only the back and forward links
    $total_recs = $pg->get_total_rows();
    // the total number of records*/
    //=============================================
    return array('data' => $data, 'result' => $r, 'total_recs' => $total_recs, 'nav_links' => $nav_links, 'nav_info' => $nav_info, 'simple_nav_links' => $simple_nav_links);
}
开发者ID:Khum,项目名称:SDFU,代码行数:33,代码来源:functions.inc.php


注:本文中的paging::get_page_num_rows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。