本文整理汇总了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;
}
示例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>
示例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>