[phplib] Problem in num_rows() From: NickM (nick <email protected>)
Date: 07/13/00

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>