Move apply_sql_function

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@976 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-08-18 09:19:54 +00:00
parent e0fbf333e7
commit e3310672d2
2 changed files with 4 additions and 7 deletions

View file

@ -359,6 +359,10 @@ function dump_csv($row) {
echo implode(",", $row) . "\n";
}
function apply_sql_function($function, $column) {
return ($function ? ($function == "count distinct" ? "COUNT(DISTINCT " : strtoupper("$function(")) . "$column)" : $column);
}
function is_email($email) {
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component

View file

@ -16,13 +16,6 @@ foreach ($fields as $key => $field) {
$rights += $field["privileges"];
}
function apply_sql_function($function, $column) {
return ($function
? ($function == "count distinct" ? "COUNT(DISTINCT " : strtoupper("$function(")) . "$column)"
: $column
);
}
list($select, $group) = $adminer->selectColumnsProcess($columns, $indexes);
$where = $adminer->selectSearchProcess($fields, $indexes);
$order = $adminer->selectOrderProcess($fields, $indexes);