本文整理汇总了PHP中DataBase::count方法的典型用法代码示例。如果您正苦于以下问题:PHP DataBase::count方法的具体用法?PHP DataBase::count怎么用?PHP DataBase::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: max
<a href="?page=<?php
echo max(1, $page - 1) . $queryString;
?>
">Anterior</a>
<a href="?page=<?php
echo min($page + 1, $pages) . $queryString;
?>
">Siguiente</a>
<a href="?page=<?php
echo ceil($registros / $nrpp) . $queryString;
?>
">Última</a>
</td>
<td>
<span>Total: <?php
echo $bd->count("usuario");
?>
</span>
</td>
</tr>
</tfoot>
<?php
foreach ($usuarios as $indice => $usuario) {
if ($usuario->getAdministrador() !== "1") {
?>
<tr>
<td><?php
echo $usuario->getEmail();
?>
</td>
<td><?php
示例2: count
}
/**
* with access only
* */
if (!$Auth->isAdmin($_COOKIE['id'], $_COOKIE['hash'])) {
$_RETURN['errorMsg'] = 'Недостаточно прав!';
$_RETURN['status'] = -1;
$_RETURN['data'] = null;
echo json_encode($_RETURN);
exit;
}
if ($_GET['core']) {
$_m = $_GET['core'];
if ($_m == 'menuList') {
require_once _ENGINE . 'MenuList.php';
$array['unread'] = $Db->count('SELECT count(*) FROM reviews WHERE visible = ' . $Db->quote(0));
$leftNavigation = array(new MenuList('Основное', '#/main/calendar', 'fa-dashboard', 'fa-angle-left pull-right', array(new MenuList('Календарь', '#/main/calendar', 'fa fa-calendar'), new MenuList('Калькулятор', '#/main/calculator', 'fa-calculator'))), new MenuList('Отзывы', '#/reviews', 'fa-commenting-o', 'fa-angle-left pull-right', array(new MenuList('Отзывы', '#/reviews', 'fa-list'))), new MenuList('Пользователи', '#/user/all', 'fa-user', 'fa-angle-left pull-right', array(new MenuList('Все', '#/user/all', 'fa-users'), new MenuList('Добавить', '#/user/add', 'fa-user-plus'))), new MenuList('Галерея', '#/galary/all', 'fa-th', 'fa-angle-left pull-right', array(new MenuList('Все', '#/galary/all', 'fa-photo'), new MenuList('Категории', '#/galary/categories', 'fa-list'), new MenuList('Загрузка', '#/galary/add', 'fa-upload'))));
$_RETURN['status'] = 1;
$_RETURN['data'] = $leftNavigation;
echo json_encode($_RETURN);
}
// Список категорий и их итемов для калькуляции
if ($_m == 'calcCategory') {
$array = $Db->select('
SELECT
c.id as catId,
c.name as catName,
c.image as catImage,
i.id as iId,
i.name as iName,
i.description as iDesc,