summaryrefslogtreecommitdiff
path: root/classes/database/Postgres.php
diff options
context:
space:
mode:
authorchriskl2005-11-04 04:24:13 +0000
committerchriskl2005-11-04 04:24:13 +0000
commit16d1eb48ce74e3d0858a9db89d67ce9b806faad6 (patch)
tree9c6677b69b21da0e3f102d1c71a3c4f143ba15d8 /classes/database/Postgres.php
parentb139f7b149cf395d409f409045be8ad06055b164 (diff)
Fix bug when using multiple order bys in getSelectSQL. Fix ordering in reports list.REL_3-5
Diffstat (limited to 'classes/database/Postgres.php')
-rwxr-xr-xclasses/database/Postgres.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php
index e5f12af3..9244a559 100755
--- a/classes/database/Postgres.php
+++ b/classes/database/Postgres.php
@@ -4,7 +4,7 @@
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.250.2.7 2005/10/18 03:15:58 chriskl Exp $
+ * $Id: Postgres.php,v 1.250.2.8 2005/11/04 04:24:13 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -3806,8 +3806,17 @@ class Postgres extends ADODB_base {
// ORDER BY
if (is_array($orderby) && sizeof($orderby) > 0) {
$sql .= " ORDER BY ";
+ $first = true;
foreach ($orderby as $k => $v) {
- $sql .= $k;
+ if ($first) $first = false;
+ else $sql .= ', ';
+ if (ereg('^[0-9]+$', $k)) {
+ $sql .= $k;
+ }
+ else {
+ $this->fieldClean($k);
+ $sql .= '"' . $k . '"';
+ }
if (strtoupper($v) == 'DESC') $sql .= " DESC";
}
}