From: chriskl Date: Tue, 10 Feb 2004 06:55:08 +0000 (+0000) Subject: allow editing select results by oid. that will make some people happy. X-Git-Tag: REL_3-3-1~27 X-Git-Url: http://git.postgresql.org/gitweb/delmail?a=commitdiff_plain;h=575de8619e61a0938414691ca2aeff867f1de093;p=phppgadmin.git allow editing select results by oid. that will make some people happy. --- diff --git a/BUGS b/BUGS index beb36460..f71b2f45 100644 --- a/BUGS +++ b/BUGS @@ -13,7 +13,6 @@ test < 7.3 Find feature for all new objects fix constraint search to get domain and table constraints? dump sequences when dumping tables fix dumping clustering info -can't edit SELECT results by oid Need to fix: * The getType function needs to be ported to 7.2 and 7.3 classes to add @@ -21,5 +20,5 @@ Need to fix: * Report login errors * Edit Query * Don't offer owner change feature if user is not superuser - +* fix encoding in popup window diff --git a/HISTORY b/HISTORY index 7943b9d7..a2a0948d 100644 --- a/HISTORY +++ b/HISTORY @@ -15,6 +15,7 @@ Features * Display user session defaults for PostgreSQL >= 7.3 * Rename user feature for PostgreSQL >= 7.4 * Create functions returning arrays and table types +* Allow editing Select results by oid Bugs * Object browser fixed for databases with no schemas diff --git a/classes/database/BaseDB.php b/classes/database/BaseDB.php index 610a5eff..a2a36006 100644 --- a/classes/database/BaseDB.php +++ b/classes/database/BaseDB.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: BaseDB.php,v 1.38 2004/02/02 12:15:58 chriskl Exp $ + * $Id: BaseDB.php,v 1.39 2004/02/10 06:55:09 chriskl Exp $ */ include_once('./classes/database/ADODB_base.php'); @@ -161,12 +161,20 @@ class BaseDB extends ADODB_base { // If an empty array is passed in, then show all columns if (sizeof($show) == 0) { if ($this->hasObjectID($table)) - $sql = "SELECT oid, * FROM "; + $sql = "SELECT \"{$this->id}\", * FROM "; else $sql = "SELECT * FROM "; } - else - $sql = "SELECT \"" . join('","', $show) . "\" FROM "; + else { + // Add oid column automatically to results for editing purposes + if (!in_array($this->id, $show) && $this->hasObjectID($table)) + $sql = "SELECT \"{$this->id}\", \""; + else + $sql = "SELECT \""; + + $sql .= join('","', $show) . "\" FROM "; + } + if ($this->hasSchemas() && isset($_REQUEST['schema'])) { $this->fieldClean($_REQUEST['schema']); $sql .= "\"{$_REQUEST['schema']}\".";