static function max($table, $column, $where = null)
{
$sql = 'SELECT MAX(' . $column . ') AS max FROM ' . self::prefix($table);
if (!empty($where)) {
$sql .= ' WHERE ' . self::where($where);
}
$result = self::query($sql, false);
$result = self::fetch($result);
return a::get($result, 'max', 1);
}