PHP 4.0 Bug #6421: PEAR - error emulating prepare/execute with PostgreSQL
| From: | heino at bigfoot dot com | Date: | Tue, 29 Aug 2000 18:51:55 +0000 |
| Subject: | PHP 4.0 Bug #6421: PEAR - error emulating prepare/execute with PostgreSQL | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-31106@lists.php.net to get a copy of this message | ||
From: heino@bigfoot.com
Operating system: Debian 2.2
PHP version: 4.0 Latest CVS (29/08/2000)
PHP Bug Type: Other
Bug description: PEAR - error emulating prepare/execute with PostgreSQL
What does the following line in DB/common.php do ?
(line 182:) $stmt = (int)$this->prepare_maxstmt++;
I have to outcomment the line when I recall execute() on the same prepared query!
In the original code $realquery, in execute(), is set to the following string when calling it again
with the same prepared query...
[db_error: message="DB Error: invalid" code=-8 mode=return level=notice
prefix="" prepend="" append=""]
--------------------------------
example:
<?php
include("/usr/lib/php4/DB/pgsql.php");
$dsn = 'pgsql://127.0.0.1/web';
$db = new DB_pgsql();
$db->connect($dsn);
$stm = $db->prepare('SELECT * FROM pg_type WHERE typname = ? ORDER BY typname;');
$r1 = $db->execute($stm, array('_point'));
$r2 = $db->execute($stm, array('_bit'));
while($b = $db->fetchrow($r1)) {
echo $b[0].' - '.$b[1].'<br>';
}
while($b = $db->fetchrow($r2)) {
echo $b[0].' - '.$b[1].'<br>';
}
?>