Re: Probably there is better solution
| From: | Gonzalo Vera | Date: | Thu, 11 Jan 2001 19:45:48 +0000 |
| Subject: | Re: Probably there is better solution | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4928@lists.php.net to get a copy of this message | ||
Check out mysql_num_rows and the COUNT function in MySQL: both are
good, quick ways of getting that number without looping through your
whole result set.
Gonzalo.
> Hi all,
> I have to know how many entries I have in table/database. Usually, I use
> $result = mysql_query("SELECT any_name_of_column FROM table_name", $db);
> while($myrow = mysql_fetch_array($result));
> {
> $Counter++;
> }
> echo"No of entries: $Checker<br>\n";
> Probably there is better and faster solution.
> Thanks for any help!
> Afan