Re: multiple count (*) from php? (last one got sent in error, this is the correct one)
| From: | Jim Lucas | Date: | Tue, 17 Jun 2003 00:12:50 +0000 |
| Subject: | Re: multiple count (*) from php? (last one got sent in error, this is the correct one) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151759@lists.php.net to get a copy of this message | ||
Took me a minute to figure out what you are trying to do, but I think I have
it now.
Try this.
$result = "SELECT ptype, count(*) FROM mylist_slave WHERE and
user='".$my_user."' and cno='".$my_ccno."' GROUP BY
ptype";
this will return you the number of rows that is the same number of packages
they have setup.
Jim Lucas
----- Original Message -----
From: "Ryan A" <ryan@jumac.com>
To: <php-general@lists.php.net>
Sent: Saturday, June 14, 2003 8:26 PM
Subject: [PHP] multiple count (*) from php? (last one got sent in error,
this is the correct one)
> Hi,
> I have 5 tables which keep th details for 5 packages for a company...
> a company may add however many packages they wish.
>
> When a company logs in I want to be able to tell them:
>
> you have $numberOfPackages entered:
> package1 $one
> package2 $two
> package3 $three
> package4 $four
> package5 $five
>
> instead of running 5 "$result = "SELECT count(*) FROM mylist_slave WHERE
> ptype =$inn and user='".$my_user."' and
> cno='".$my_ccno."'";
>
> is there any any way to select all 5 differient tables in one select
> count(*) statement?
>
> Thanks,
> -Ryan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>