Re: Fast count of recordset in php...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux