hey, you could do something like this <?php $query = "SELECT * FROM `table` Group by email"; $query_count++; $result = mysql_query ($query); while ($row = mysql_fetch_assoc ($result)) { $title = $row["title"]; $first_name= $row["first name"]; $company = $row["company"]; echo"title: $title <br> first_name: $first_name <br> company: $company"; } ?>
From: Tristan.Pretty@xxxxxxxxxxxxxxxx To: Jonathan Haddad <jhaddad@xxxxxxxxxxxxxxxxx> CC: php-db@xxxxxxxxxxxxx Subject: Re: DISTINCT and multiple results... Date: Mon, 7 Jun 2004 14:05:41 +0100
Ah, but then how can I select other info from the same table (title, first name, company etc...)
Jonathan Haddad <jhaddad@xxxxxxxxxxxxxxxxx> 07/06/2004 13:39
To Tristan.Pretty@xxxxxxxxxxxxxxxx cc php-db@xxxxxxxxxxxxx Subject Re: DISTINCT and multiple results...
select distinct email, username from table
On Jun 7, 2004, at 8:19 AM, Tristan.Pretty@xxxxxxxxxxxxxxxx wrote:
> Hi there... > I'm trying to create a MYSQL query that does the following... > > I've a table that lists ALL downloads from our site. > so I may have the same user many times, but different files, or infact, > same user, same file. > What my boss wants to see is: > If a user downloaded a file 3 times, she doesn't care, she just wants > to > see that it was downloaded. > So I tried using DISTINCT(email), but then I loose the data about the > other files that they've downloaded > How can I create a query, where I can list only one instance of email, > per > multiple instatnces of a file name. > > Does that make sence? > I'm reallyu stumped... > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- Jonathan Haddad jhaddad@xxxxxxxxxxxxxxxxx http://www.superwebstuff.com
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Get fast, reliable Internet access with MSN 9 Dial-up ? now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php