Re: Hello!

From: Date: Sat, 15 Jun 2002 05:22:15 +0000
Subject: Re: Hello!
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1672@lists.php.net to get a copy of this message
Hi This is the reason $sql = "SELECT * FROM page WHERE pnumber='$p'"; $page_data = $db->fetchRow($sql); $num->numRows($page_data); print $num; ******************* END ***************************** Pradeep Dsouza naharonline.com ----- Original Message ----- From: "Jesus M. Castagnetto" <jcastagnetto@yahoo.com> To: "Sean Chambers" <ChambersS@vanndata.com>; <pear-general@lists.php.net> Sent: Saturday, June 15, 2002 3:41 AM Subject: Re: [PEAR] Hello! > 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 > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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