Вход Регистрация
Файл: sys/core/count.php
Строк: 24
<?php

class count
{
    public static function 
query($table = null, $where = null, $color = null)
    {
        if (
$table != null) {
            if (
$where != null) {
                
$where = ' where '. $where;
            } else {
                
$where = null;
            }
        
            if (
$color != null) {
                
$color = '<span style="color:#'. $color .';">';
                
$color_end = '</span>';
            } else {
                
$color = null;
                
$color_end = null;
            }
            
$cnt = goDBquery('SELECT COUNT(*) AS cnt FROM ?t ?q', [$table, $where])->row();

            return 
$cnt['cnt'] ? $cnt['cnt'] : 0;
        }
    }
}
Онлайн: 2
Реклама