$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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to