...

Number of Records Returned

Thelma
08-22-2002, 04:45 PM
Any tips on how to count up the number of records returned from a search ?

Thanks

Spookster
08-22-2002, 11:02 PM
SELECT COUNT(*) FROM TABLENAME WHERE FIELDNAME = 'foobar';

Thelma
08-23-2002, 03:43 PM
Thanks!

freakysid
08-31-2002, 03:04 PM
Or if you wish to know how many rows there are in the result set (the results of your query).

$sql = "SELECT COUNT(*) FROM TABLENAME WHERE FIELDNAME = 'foobar'";
$result = mysql_query($sql);
$numRows = mysql_num_rows($result);

:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum