Posted by Matt Darby on 09/30/70 11:23
$num=mysql_num_rows($sql);
Gustav Wiberg wrote:
> Hello there!
>
> How do i get a fast count of a recordset in php?
>
> Look at this code:
>
> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'";
> $querys = mysql_query($sql);
>
> //Count products in db
> //
> $dbArray = mysql_fetch_array($querys);
> $nrOfProducts = $dbArray["cn"];
>
>
> It's slow... Why? Any suggestions?
>
> /mr G
> @varupiraten.se
>
Navigation:
[Reply to this message]
|