Re: number of records
| From: | Cory Hicks | Date: | Tue, 10 Dec 2002 17:39:51 +0000 |
| Subject: | Re: number of records | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127683@lists.php.net to get a copy of this message | ||
Diana,
This is how I typically do this with mysql_num_rows:
$sql = "SELECT * FROM sometable
WHERE field LIKE '%$field%' LIMIT 0, 30 ";
$result = mysql_query($sql)
or die ("Error In Query:".mysql_error());
$num_results = mysql_num_rows($result);
HTH!
Cory
On Tue, 2002-12-10 at 09:54, Diana Castillo wrote:
> After I run a query lik this,
> $db->query($sql);
>
> what is the quickest way to find out how many records result? Without having
> to loop through them all?
>
> Thank you ,
> Diana
>
--
Cory Hicks <chicks@tri-intl.com>
TRI-International