Re: count
| From: | David Robley | Date: | Thu, 11 Apr 2002 11:15:50 +0000 |
| Subject: | Re: count | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18428@lists.php.net to get a copy of this message | ||
In article <20020411110648.27406.qmail@pb1.pair.com>,
allenr@fwd.areur.army.mil says...
> I know how to get the results for the total number of records
> select count(*) from $table
> but how do I put them into a variable for me to use later???
>
> "David Robley" <robleyd@paradise.net.nz> wrote in message
> news:MPG.172032f7880e5ab69896eb@news.php.net...
> > In article <20020411104550.8417.qmail@pb1.pair.com>,
> > allenr@fwd.areur.army.mil says...
> > > I would like to count all the total records from a database. How would
> I go
> > > about doing that???
> >
> > Do a COUNT * on each table and total the results? Although the results
> > may actually not mean much depending on your DB structure. Or do you
> > really mean count records in a _table_?
Aliases. SELECT COUNT(*) AS howmany FROM table
Then use the variable $howmany
--
David Robley
Temporary Kiwi!
Quod subigo farinam