Re: [PHP-PEAR] Pear DB and MySQL?
[email protected] (John Meredith)
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
Not sure if this is the official way, but it works for me:
$num_rows_in_result = mysql_num_rows($result->result);
- John
On Mon, Feb 05, 2001 at 10:16:46PM +0800, Winnie wrote:
> Hi,
>
> I need some help with using PEAR DB with MYSQL. I would like to know how to
> get the number of rows returned by a resultset! there are two functions:
> numCols and numRows in the class for postgres, but only numCols for mysql!
>
> When I try to write my own function for numRows as follows:
>
>
> ----------------------
> function numRows($result)
> {
> $rows = mysql_num_rows($result);
> if (!$rows)
> {
> return
>
> $this->raiseError($this->errorCode(mysql_errno($this->connection)));
> }
> return $rows;
> }
> ----------------------
>
> I put the above function in MYSQL.PHP but it does not work. Can someone tell
> me how I can add a function for the MYSQL database, or if not, then how to
> SUBCLASS the file and use my own functions? Is there anyone who has
> developed more classes for the PEAR DB?
>
> Please help! I would appreciate any advice/pointers!
>
> Hopefully,
> Winnie
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.230 / Virus Database: 111 - Release Date: 25-Jan-01
>
>
>
> --
> 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: [email protected] from the
> mail address you subscribed with.
--
John "Neutiquam erro" Meredith <[email protected]>