Worawisut Pinyoyang wrote:
> To all PHP-db guruz!
>         I'm novice on Oracle(OCI).In mysql has mysql_num_rows().
> When i try to find OCI function about num rows i see OCIRowCount().
> But in the manual told me that it cannot use with select statement.
> How can i know the number of selected row?

Oracle can't tell you that because it starts returning rows as it finds
them in the database so the client (PHP) starts getting query results
before reaching to the end of the search so it can't tell in advance the
number of selected rows. The alternative is to buffer all rows in array
but that's resource consuming for large result sets. A better
alternative is to issue a first query with SELECT COUNT(*) FROM tables
where conditions.

Anyway, you may want to Metabase that is a database abstraction package
that implements the first technique for the Oracle driver if you use the
MetabaseNumberOfRows function.

You may download Metabase for free from here:


Manuel Lemos

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to