Page 1 of 1

[Solved] Filtering out duplicated results

Posted: Fri May 27, 2005 5:38 am
by Addos
I wonder if anybody can give me some pointers as to how to deal with filtering out duplicated results. I have a setup where I have names and addresses that depending on the query can sometimes return duplicate names and addresses. Is this easy to do? I just can’t think of how to approach this in PHP.
Thanks a mil
Brian

Posted: Fri May 27, 2005 5:41 am
by harrisonad
use GROUP BY in your query.

Posted: Fri May 27, 2005 5:43 am
by malcolmboston

Code: Select all

$query = "SELECT distinct something FROM somewhere";
$result = mysql_query($query) or die (mysql_error());

Posted: Fri May 27, 2005 6:39 am
by Addos
Thanks the 'Group By' was what I needed. :oops:

Brian