}
if ($where) $where = " WHERE ($where)";
- if ($count) {
- $group = $group == '' ? "*" : "DISTINCT $group";
-
- return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count";
- }
+ if ($count)
+ return "SELECT COUNT(*) FROM ($this->sql) tmp_count";
$sql = "$select FROM $from $where";
if ($group) $sql.= " GROUP BY $group";
if(isset($col['ord_priority'])) {
$columns[$col['ord_priority']] = $col;
}
- }
- krsort($columns);
+ }
+ krsort($columns);
foreach ($columns as $col) {
if (isset($col['ord'])) {
}
}
}
-
+
if (count($ord)) {
$ord = array_map(function_exists('mysql_real_escape_string') ?
'mysql_real_escape_string': 'mysql_escape_string', $ord);