Re: Fast count of recordset in php...
| From: | Matt Darby | Date: | Sat, 06 Aug 2005 21:21:10 +0000 |
| Subject: | Re: Fast count of recordset in php... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220153@lists.php.net to get a copy of this message | ||
$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