Re: Comparing Data
| From: | Michael Sims | Date: | Wed, 14 Aug 2002 01:46:33 +0000 |
| Subject: | Re: Comparing Data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112464@lists.php.net to get a copy of this message | ||
On Tue, 13 Aug 2002 21:31:22 -0400, you wrote:
>Well, the only problem is, the data will be outputted into a dropdown box, so a loop would cause
>duplicates of the ID.
>
>Guess I should have mentioned that there are approx 50 ID's and they are not unique. The
>only way I can think of doing it is something like:
[...]
>Any other possibilities out there?
Are you just looking for duplicate ID's? If so, put the work on the
SQL server, not PHP:
select id,count(*) as cnt from table group by id having cnt > 1