Re: [PHP] Fast count of recordset in php...

2005-08-07 Thread Satyam
"Marcus Bointon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > According to the docs, MySQL has a particular optimisation that means > that it should be: > > $sql = "SELECT COUNT(*) FROM tbvara WHERE Varunamn LIKE '$checkLev%'"; > It is not just a MySql optimization but this ho

Re: [PHP] Fast count of recordset in php...

2005-08-07 Thread Marcus Bointon
On 7 Aug 2005, at 05:04, TalkativeDoggy wrote: be coz this way is slow and costs more overload. $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE '$checkLev%'"; $querys = mysql_query($sql); //Count products in db // $dbArray = mysql_fetch_row($querys); $nrOfP

Re: [PHP] Fast count of recordset in php...

2005-08-06 Thread Gustav Wiberg
27;re right, I can add an index, but Is that the only way to get a faster solution? /mr G @varupiraten.se - Original Message ----- From: "Sebastian" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Saturday, August 06, 2005 11:08 PM Subject: R

Re: [PHP] Fast count of recordset in php...

2005-08-06 Thread TalkativeDoggy
ster solution? /mr G @varupiraten.se - Original Message - From: "Sebastian" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Saturday, August 06, 2005 11:08 PM Subject: Re: [PHP] Fast count of recordset in php... how many records in the t

Re: [PHP] Fast count of recordset in php...

2005-08-06 Thread Sebastian
rds. You're right, I can add an index, but Is that the only way to get a faster solution? /mr G @varupiraten.se - Original Message - From: "Sebastian" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Saturday, August 06, 2005 11:08

Re: [PHP] Fast count of recordset in php...

2005-08-06 Thread Matt Darby
$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 =

[PHP] Fast count of recordset in php...

2005-08-06 Thread Gustav Wiberg
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 = $dbA