Re: [phplib] why $db->nf() returns 0 all the time??? From: Pascal Jolin (pjolin <email protected>)
Date: 09/07/00

>From Documentation:

num_rows(), nf()

Returns the number of rows returned by the current SELECT query.

Note: This information is not available in all database interfaces. Some of
the more advanced databases begin to return query results asynchronously
while the backend is still appending result rows. In such environments the
complete size of the result set is never known.

You should duplicate your WHERE clause of the query in such environments and
ask for the COUNT(*). This will be less inefficient as it seems as the query
path and query result have been cached by the database.
So in your case....

$db=new DB_Sql();
$query="select count(*) from MyTable";
$db->query($query);
$db->next_record();
if($db->f(0)) {
  $query="select * from MyTable";
  $db->query($query);
  while($db->next_record() {
    .......
  }
}

----- Original Message -----
From: "raysoft" <raysoft <email protected>>
To: <phplib <email protected>>
Sent: Wednesday, September 06, 2000 8:31 PM
Subject: [phplib] why $db->nf() returns 0 all the time???

> I am using phplib7.2c to visit Oracle db.
> I am using db_oci8.inc file.
> but when I do this:
>
> $db=new DB_Sql();
> $query="select * from MyTable";
> $db->query($query);
> if($db->nf()) //?????!!!!!
> {
> while($db->next_record()
> {
> .......
> }
> }
>
> The function $db->nf() alwarys return 0!! even if there is some records in
MyTable.
> why?
> when I use this with MySql, It do thing OK.
> Is't Oracle's fault or Phplib's??
> Help me please!! Thank u very much!!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>