on DB/pgsql.php
| From: | Mark Kirkwood | Date: | Thu, 07 Dec 2000 05:38:25 +0000 |
| Subject: | on DB/pgsql.php | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-596@lists.php.net to get a copy of this message | ||
Hi all,
I am hoping to use the PEAR DB layer for an application soon ( about a
month or so ).
I was intending to use postgresql, but I need the affectedRows
functionality.
Any ideas when this is planned to be implemented ?
....in the meantime I hacked a "working" version in DB/pgsql.php ( see
below for a diff output)
Cheers
Mark
$ diff pgsql.php-orig pgsql.php
4c4
< // | PHP version
4.0 |
---
> // | PHP version
4.0.1 |
17c17,19
< //
| |
---
> // | Mark Kirkwood
<markir@i4free.co.nz> |
> // | Added affected rows stuff ( marked with //**
) |
> // | and the function affectedRows too...
) |
59a62
> var $affected; // **
405a409,410
> $this->affected = 0; // **
> $this->affected = pg_cmdtuples($result); // **
448a454,474
>
> // }}}
> // {{{ affectedRows()
>
> /**
> * Gets the number of rows affected by the last query.
> * if the last query was a select, returns 0.
> *
> * @return number of rows affected by the last query or DB_ERROR
> */
> function affectedRows() {
> $result = $this->affected;
> if ($result === false) {
> return $this->raiseError();
> }
> return $result;
> }
>
> // }}}