Re: DB: number of rows returned

From: Date: Tue, 14 Nov 2000 17:33:20 +0000
Subject: Re: DB: number of rows returned
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-440@lists.php.net to get a copy of this message
Tracy Finifter wrote: > > mysql_num_rows ($res); It sounds like he is looking for a DB independent function that would do that (otherwise why even use PEAR DB). Under OCI8 (Oracle 8) implementation there is a method called affectedRows that returns number of resulting rows. Unfortunately mysql implementation doesn't contain that method (or ate least I don't see it in my 4.0.2 distrib). You could potentially add the affectedRows method into mysql.php that would to mysql_num_rows ($res); Vladimir > > Is there a method for finding out how many rows a query returned? > > > > {{{ Example: > > > > <?php > > > > include_once("DB.php"); > > $db = DB::connect("mysql://user:passwd@localhost/database"); > > > > $res = $db->query("SELECT * FROM members WHERE name='$name'"); > > > > echo $res->numRows(); > > > > ?> > > > > }}} > > > > -Tobias- > > > > > > -- > > PHP Extension and Add-on Repository (PEAR) mailing list. > > Documentation can be found at > > http://pear.php.net/doc/pear.html > > To unsubscribe, e-mail: php-pear-unsubscribe@lists.php.net from the > > mail address you subscribed with. > > > > -- > PHP Extension and Add-on Repository (PEAR) mailing list. > Documentation can be found at http://pear.php.net/doc/pear.html > To unsubscribe, e-mail: php-pear-unsubscribe@lists.php.net from the > mail address you subscribed with. -- Vladimir

« previous php.pear (#440) next »