On 08-Jul-01 Nelson Goforth wrote:
> I thought "mysql_numrows(result_identifier)" - which I'm using to get
> the number of rows in the found set - was ONLY to get the number of
> rows in the result set. What I'm after is how to get the number of
> rows in an entire table without doing a search to find everything in
> the table (concerned that this a waste of processor time).
>
I got the impression you were displaying the whole table, sorry.
to get the number of rows:
$qry='SELECT count(*) as cnt from da_table';
$res = mysql_query($qry);
if ($res) {
$row = mysql_fetch_object($res);
echo 'There\'s ', $row->cnt, ' row(s) in there';
} else {
die ('<P>Rut-row ' .mysql_errno() .mysql_error());
}
> However, I did try it without argument as you suggest, but got an
> error message (wrong parameter count).
>
That was a reference to the manual entry, not a code snippet.
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php