[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-pear
Subject:    Re: [PHP-PEAR] DB: number of rows returned
From:       Vladimir Vuksan <vuksan () cs ! unm ! edu>
Date:       2000-11-14 17:33:20
[Download RAW message or body]

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

-- 
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.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic