On Sunday 25 August 2002 22:07, salamander wrote:
> or, you should be able to simply do this, without the cost of fetching
> the results:
>
> $result = mysql_query("SELECT count(*) FROM table WHERE");
> $num_rows = mysql_num_rows($result);
> echo "$num_rows Rows\n";
No. This only returns 1 row regardless. "SELECT COUNT(*) FROM ..." only
returns a single row with a single column containing the row count. Using
mysql_num_rows() on that will always return 1.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
I'm going to Vietnam at the request of the White House. President Johnson
says a war isn't really a war without my jokes.
-- Bob Hope
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php