Re: Pear DB and MySQL?

From: Date: Tue, 06 Feb 2001 13:41:32 +0000
Subject: Re: Pear DB and MySQL?
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1265@lists.php.net to get a copy of this message
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: php-pear-unsubscribe@lists.php.net from the > mail address you subscribed with. -- John "Neutiquam erro" Meredith <johnm@psynix.com>

« previous php.pear (#1265) next »