Re: [Fwd: [PHP-DB] Oracle functions]

From: Date: Mon, 03 Dec 2001 20:16:53 +0000
Subject: Re: [Fwd: [PHP-DB] Oracle functions]
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14773@lists.php.net to get a copy of this message
Hi Dan, I tried "$n = ora_numcols($odb); echo "number = $n\n"; This resulted in '0' which I know is incorrect. It should be '1' = the number in the table. Any other ideas. Please advise. Thanks. Daniel Barton wrote: > ooops, forgot to reply to list too. > > -- > ---------- > Dan Barton > Terrestrial Program Biologist > Asst. Data Manager > Point Reyes Bird Observatory > http://www.prbo.org > dbarton@prbo.org > dbarton@grayflycatcher.org > > ------------------------------------------------------------------------ > > Subject: Re: [PHP-DB] Oracle functions > Date: Mon, 03 Dec 2001 08:46:23 -0800 > From: Daniel Barton <dbarton@prbo.org> > To: John Kolvereid <odin@op.net> > References: <3C0BD518.DAE51065@op.net> > > Hola, > Check out the php manual for an explanation of resources and arrays etc. > > "Resource ID #6" IS the result of your query - PHP stores it as a > "Resource." I've only used PostgreSQL and MySQL with PHP, and what you need > to do with a query result "resource" using these two databases is "fetch" > the data from it using a command such as mysql_fetch_array or mysql > _fetch_assoc. > From http://www.php.net/manual/en/ref.oracle.php it looks > like you would > need to use ora_fetch to convert the "resource" into a PHP array. On this > page, there's a code example of how to use PHP's Oracle functions to extract > data from a database and output HTML. > > Cheers, > db > > John Kolvereid wrote: > > > Hi, > > I am relatively new to Oracle PHP and trying to figure out the > > Oracle functions. I am able to connect and open a db. But that's the > > extent of what I can do w/o further explanation. Within the PHP docs I > > can view all the Oracle functions, but their explanations are sparse to > > say the least. I tried the following: > > $i = ora_do($conn, "Select count(*) from patients"); > > echo "returned $i\n"; > > The statement is valid, I use it all the time in SQL+ and DBI. However > > in PHP it returns 'Resource ID #6' I am not sure that is a result of > > the echo statement or the ora_do function. Please advise, and let me > > know where a better Oracle/PHP document resides. Thanks. > > > > -- > > John Kolvereid > > http://www.odinfo.com > > http://www.kolvereid.com > > odin@op.net > > 1.610.296.4485 > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > ---------- > Dan Barton > Terrestrial Program Biologist > Asst. Data Manager > Point Reyes Bird Observatory > http://www.prbo.org > dbarton@prbo.org > dbarton@grayflycatcher.org -- John Kolvereid http://www.odinfo.com http://www.kolvereid.com odin@op.net 1.610.296.4485

« previous php.db (#14773) next »