Re: MySQL ResultSet - count rows?
- From: Christoph <christoph.burschka@xxxxxxxxx>
- Date: Mon, 10 Dec 2007 05:14:22 -0800 (PST)
On Dec 10, 10:45 am, Sabine Dinis Blochberger <no.s...@xxxxxxxxxxxx>
wrote:
Christoph wrote:
Hello,
I am writing the data of a ResultSet object to an array. To declare
the array length, I need to know the number of rows before copying
them - is there a way to read the row count instantly, without having
to iterate anything?
PHP has mysql_count_rows, but I'm not sure what that does internally -
it may just iterate over the data too.
There is a SQL statement to the effect: select count(*) from tablename
Look it up to see if it can be optimized.
--
Sabine Dinis Blochberger
Op3racionalwww.op3racional.eu
Thanks. Right now I'm looping over result.next, but I'll try sending a
COUNT() query to compare speeds.
.
- Follow-Ups:
- Re: MySQL ResultSet - count rows?
- From: Dyreatnews
- Re: MySQL ResultSet - count rows?
- References:
- MySQL ResultSet - count rows?
- From: Christoph
- Re: MySQL ResultSet - count rows?
- From: Sabine Dinis Blochberger
- MySQL ResultSet - count rows?
- Prev by Date: Re: MySQL ResultSet - count rows?
- Next by Date: Re: MySQL ResultSet - count rows?
- Previous by thread: Re: MySQL ResultSet - count rows?
- Next by thread: Re: MySQL ResultSet - count rows?
- Index(es):
Relevant Pages
|