* the functions provided by the database driver exclusively, and hence
* will work with any database without modification.
*
- * $Id: Reports.php,v 1.14 2005/10/18 03:45:16 chriskl Exp $
+ * $Id: Reports.php,v 1.15 2005/11/04 04:19:41 chriskl Exp $
*/
class Reports {
$sql = $this->driver->getSelectSQL('ppa_reports',
array('report_id', 'report_name', 'db_name', 'date_created', 'created_by', 'descr', 'report_sql'),
- $filter, $ops, array(2 => 'asc'));
+ $filter, $ops, array('db_name' => 'asc', 'report_name' => 'asc'));
return $this->driver->selectSet($sql);
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.277 2005/10/18 03:45:16 chriskl Exp $
+ * $Id: Postgres.php,v 1.278 2005/11/04 04:19:41 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @param $show An array of columns to show. Empty array means all columns.
* @param $values An array mapping columns to values
* @param $ops An array of the operators to use
- * @param $orderby (optional) An array of column numbers (one based)
+ * @param $orderby (optional) An array of column numbers or names (one based)
* mapped to sort direction (asc or desc or '' or null) to order by
* @return The SQL query
*/
// ORDER BY
if (is_array($orderby) && sizeof($orderby) > 0) {
$sql .= " ORDER BY ";
+ $first = true;
foreach ($orderby as $k => $v) {
+ if ($first) $first = false;
+ else $sql .= ', ';
$sql .= $k;
if (strtoupper($v) == 'DESC') $sql .= " DESC";
}