I think you want to use the DISTINCT keyword as part of your SELECT query
Lets say you have a database schema in a database table named People:
Lastname Firstname
Smith John
Smith Sally
Smith Joe
Kobashi Kerry
Jones Perry
Jones Sam
Williams Henry
$mySQL = "Select Distinct Lastname from People";
would only retrieve one Smith, one Kobashi, one Jones, and one Williams.
Hope this helps!
Kerry Kobashi
Kobashi Computing