DB pgsql
| From: | Brian Abent | Date: | Mon, 11 Mar 2002 21:11:33 +0000 |
| Subject: | DB pgsql | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-4962@lists.php.net to get a copy of this message | ||
I am having a problem with pgsql. I have a valid SELECT query that begins
with parenthesis. The following code from pgsql.php seems to be preventing
me from getting a valid DB Result after executing my query.
Removing the "^" from
} elseif (preg_match('/^\s*(SELECT)\s/i', $query) &&
!preg_match('/^\s*(SELECT\s+INTO)\s/i', $query)) {
fixes my problem.
Why does the pgsql driver perform its own regular expression after
isManip()?
-brian
// Determine which queries that should return data, and which
// should return an error code only.
if ($ismanip) {
$this->affected = @pg_cmdtuples($result);
return DB_OK;
} elseif (preg_match('/^\s*(SELECT)\s/i', $query) &&
!preg_match('/^\s*(SELECT\s+INTO)\s/i', $query)) {
/* PostgreSQL commands:
ABORT, ALTER, BEGIN, CLOSE, CLUSTER, COMMIT, COPY,
CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH,
GRANT, INSERT, LISTEN, LOAD, LOCK, MOVE, NOTIFY, RESET,
REVOKE, ROLLBACK, SELECT, SELECT INTO, SET, SHOW,
UNLISTEN, UPDATE, VACUUM
*/
$this->row[$result] = 0; // reset the row counter.
$numrows = $this->numrows($result);
if (is_object($numrows)) {
return $numrows;
}
$this->num_rows[$result] = $numrows;
$this->affected = 0;
return $result;
} else {
$this->affected = 0;
return DB_OK;
}