Re: Hello!

From: Date: Fri, 14 Jun 2002 22:11:14 +0000
Subject: Re: Hello!
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1667@lists.php.net to get a copy of this message
See: http://pear.php.net/manual/en/core.db.getone.php And do read the DB documentation, so you will not use the methods incorrectly ;-) http://pear.php.net/manual/en/core.db.php Good luck and happy reading! --- Sean Chambers <ChambersS@vanndata.com> wrote: > Hi everybody. > > I've been using PEAR DB for about 3 months now and I like it a lot...I > have some basic questions though. > > When I try to do the following it doesn't seem to work: > > // Get page match from DB > $sql = "SELECT * FROM page WHERE pnumber='$p'"; > $page_data = $db->getRow($sql); > $page_data->numRows($sql); > > It tells me: Fatal error: Call to a member function on a non-object on > line 67 (the $page_data->numRows() line) > > It works if I do it like so: > $page_data = $db->query($sql); > > But then this makes it more difficult because I know which record I > want, and when I attempt to access $page_data['text'] I would have to do > it in a while loop which is a pain since there is only one record > returned > > Can I find the number of rows returned if I do a quick record grab like > that or must I do $db->query? Thanks for your help. > > > Sean Chambers > Web Developer > Vann Data Technology Centre > Daytona Beach, FL > (386) 238-1200 ext. 1205 > chamberss@vanndata.com > > ===== --- Jesus M. Castagnetto (jcastagnetto@yahoo.com) Research: http://metallo.scripps.edu/ Personal: http://www.castagnetto.org/ __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com

« previous php.pear.general (#1667) next »