Re: numRows()
| From: | Stig S. Bakken | Date: | Fri, 08 Dec 2000 03:28:19 +0000 |
| Subject: | Re: numRows() | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-609@lists.php.net to get a copy of this message | ||
"James L. Pine" wrote:
>
> affectedrows should probably decide on some standard before it gets
> written for too many db's... as far as I know, they all return the number
> of rows affected for inserts, updates, and deletes, but for selects, some
> return the number of rows in the result set (ex: mysql), while others
> return zero (ex: oci8). I implemented affectedrows a while ago for the
> oci8 interface (it's in cvs), and I had a version for mysql that I mailed
> to stig, but it probably wasn't the greatest of implementations, so it
> just disappeared into the void.
>
> anyway, just something of which to be aware.
I think oci8's behaviour is sensible: return 0 for all queries that are
not insert/update/delete.
I've changed the mysql implementation to behave like this.
What does affectedRows return for Oracle when you do "delete from
table"? Mysql_affected_rows() returns 0 in this case. This can be
emulated by sneaking in a "select (*) from" first, but that's not giving
me a warm fuzzy feeling.
- Stig