posting only one result if multiple results are equal
Posted: Wed Jul 06, 2011 8:53 am
Basically, I have a form that allows users to upload information to a mysql database. They input the last name of a person and write a comment about them. If people write about the same person, there will be multiple rows in the database with that same last name in the "name" field. Now I have it set up so people search by letter. So if there are 10 rows in the database with Smith as the last name, I don't want Smith to show up 10 times after the search. How can I get just one Smith to show up?? I'm using this a statement like this
SELECT lastname from tablename where lastname like 'S%' ... but obviosuly this gets me every row with a last name starting with S and duplicates if there is the same last name. PLEASE HELP!!
Thanks in advance.
Chris
SELECT lastname from tablename where lastname like 'S%' ... but obviosuly this gets me every row with a last name starting with S and duplicates if there is the same last name. PLEASE HELP!!
Thanks in advance.
Chris