<?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;
            }

            return $color . @mysql_result(query("SELECT COUNT(*) FROM `$table` " . $where), 0) . $color_end;
        }
    }

}
