Re: cvs: php4 /pear/DB mysql.php /pear/DB/tests/mysql 008.phpt
| From: | Ulf Wendel | Date: | Fri, 08 Dec 2000 14:06:21 +0000 |
| Subject: | Re: cvs: php4 /pear/DB mysql.php /pear/DB/tests/mysql 008.phpt | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-3032@lists.php.net to get a copy of this message | ||
Andrei Zmievski schrieb:
>
> On Fri, 08 Dec 2000, Stig Bakken wrote:
> > function affectedRows()
> > {
> > - $result = mysql_affected_rows($this->connection);
> > -
> > + if (preg_match('/(INSERT|UPDATE|DELETE)/i', $this->last_query)) {
>
> Two suggestions here:
>
> 1. Use "^" to search for those keywords at the beginning of the query.
> 2. For MySQL also add "replace" to the list.
Even more. You have check patch preg_match("/(SELECT|SHOW)/i"...) also.
Make sure, that the query string is trimmed (or ^\s*) and add DESC,
DESCRIPTION, EXPLAIN if neccessary or use isManip(). Looks to me as if
it's wrong in some places e.g. pgsql.php.
Ulf
--
Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99