if (empty($this->dboptions['forcetcp']) and ($this->dbhost === 'localhost' or $this->dbhost === '127.0.0.1')) {
$connection = "user='$this->dbuser' password='$pass' dbname='$this->dbname'";
} else {
- $connection = "host='$this->dbhost' user='$this->dbuser' password='$pass' dbname='$this->dbname'";
+ if (empty($this->dboptions['dbport'])) {
+ $port = 5432;
+ } else {
+ $port = $this->dboptions['dbport'];
+ }
+ $connection = "host='$this->dbhost' port='$port' user='$this->dbuser' password='$pass' dbname='$this->dbname'";
}
if (empty($this->dboptions['dbpersit'])) {
$this->query_start($sql, null, SQL_QUERY_AUX);
$result = pg_query($this->pgsql, $sql);
$this->query_end($result);
-
+
if ($result) {
while ($row = pg_fetch_row($result)) {
$tablename = reset($row);