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


PHP MysqliDb::withTotalCount方法代码示例

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


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

示例1: paginate

 /**
  * Pagination wraper to get()
  *
  * @access public
  * @param int $page Page number
  * @param array|string $fields Array or coma separated list of fields to fetch
  * @return array
  */
 private function paginate($page, $fields = null)
 {
     $offset = $this->pageLimit * ($page - 1);
     $this->db->withTotalCount();
     $results = $this->get(array($this->pageLimit, $offset), $fields);
     $this->totalPages = round($this->db->totalCount / $this->pageLimit);
     return $results;
 }
开发者ID:nightstomp,项目名称:PHP-MySQLi-Database-Class,代码行数:16,代码来源:dbObject.php

示例2: array

            $db2->where('action LIKE "%' . $_POST['search_term'] . '%"');
        } else {
            $db->where('action LIKE "%%"');
            $db2->where('action LIKE "%%"');
        }
        if (isset($_POST['user']) && $_POST['user'] != null) {
            $db->where('user_id="' . $_POST['user'] . '"');
            $db2->where('user_id="' . $_POST['user'] . '"');
        } else {
            $db->where('user_id LIKE "%%"');
            $db2->where('user_id LIKE "%%"');
        }
        $db->orderBy("date_time", "DESC");
        $results = $db->get("log_activity", array($limitFrom, $pageLimit));
        //$db->echoQuery();
        $db2->withTotalCount()->get("log_activity");
        $total_log = $db2->totalCount;
        echo '<div class="total-number-customers" align="center"><span class="badge badge-success">' . $total_log . ' logs found!</span></div>';
        if ($results) {
            ?>
			<table class="table-font-size table table-striped" id="dataTable">
				<thead>
		      <tr>
		        <th>#</th>
		        <th>Action</th>
		        <th>User</th>
		        <th>Date Time</th>
					</tr>
				</thead>
				<tbody>
开发者ID:arshanam,项目名称:pharmacy_app,代码行数:30,代码来源:searchFunctions.inc.php

示例3: array

            $db->orWhere('name LIKE "%%"');
            $db->orWhere('lastname LIKE "%%")');
            $db2->where('(username LIKE "%%"');
            $db2->orWhere('name LIKE "%%"');
            $db2->orWhere('lastname LIKE "%%")');
        }
        if (isset($_POST['status']) && $_POST['status'] != null) {
            $db->where('status="' . $_POST['status'] . '"');
            $db2->where('status="' . $_POST['status'] . '"');
        } else {
            $db->where('status LIKE "%%"');
            $db2->where('status LIKE "%%"');
        }
        $results = $db->get("users", array($limitFrom, $pageLimit));
        //$db->echoQuery();
        $db2->withTotalCount()->get("users");
        //$db2->echoQuery();
        $total_users = $db2->totalCount;
        echo '<div class="total-number-customers" align="center"><span class="badge badge-success">' . $total_users . ' users found!</span></div>';
        if ($results) {
            ?>
			<table class="table-font-size table table-striped" id="dataTable">
				<thead>
		      <tr>
		        <th>#</th>
		        <th>Name</th>
		        <th>Lastname</th>
		        <th>Email</th>
		        <th>Username</th>
		        <th>Backend Login</th>
		        <th>Edit</th>
开发者ID:arshanam,项目名称:pharmacy_app,代码行数:31,代码来源:searchFunctions.inc.php


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