Date: 07/13/00
- Next message: NickM: "[phplib] implode_block() from set_block()"
- Previous message: NickM: "[phplib] Problem in num_rows()"
- In reply to: NickM: "[phplib] Problem in num_rows()"
- Next in thread: Alexander Aulbach: "Re: [phplib] Problem in num_rows()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sorry, by the way that was in db_oracle.inc
----- Original Message -----
From: "NickM" <nick <email protected>>
To: <phplib <email protected>>
Sent: Thursday, July 13, 2000 11:03 AM
Subject: [phplib] Problem in num_rows()
> In num_rows, this is the logic used:
> $from_pos = strpos(strtoupper($this->lastQuery),"FROM");
> $q = "SELECT count(*) ". substr($this->lastQuery, $from_pos);
>
> This does not always work and I have found with some complex queries it
> returns the wrong value. I have now changed it in mine to simply:
> $q = "select count(*) from (".$this->lastQuery.")";
>
> Is there any reason this might not work correctly, as far as I can see the
> first one seems overkill. I guess it is for making it faster running on
the
> db, but does it? I mean it is probably more overhead to have all the
calls
> to strpos(), strtoupper(), substr().
>
> Nick
>
>
> ---------------------------------------------------------------------
> 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>
- Next message: NickM: "[phplib] implode_block() from set_block()"
- Previous message: NickM: "[phplib] Problem in num_rows()"
- In reply to: NickM: "[phplib] Problem in num_rows()"
- Next in thread: Alexander Aulbach: "Re: [phplib] Problem in num_rows()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

