PDA

View Full Version : Query Sets


atawmic
08-18-2005, 11:23 PM
I'm using PHP to query a MySQL database that has a field named image_type. This can really be any string, but more commonly, it is something that is used multiple times (eg house, boat, food, etc).

What I need to do is query the database and get a simple list of all image_type 's. A list that does not auto repeat itself basically.

So if I had image_types of: house, boat, house, food, boat in the query, it would return a list of: house, boat, food.

Does that make any sense? If so, how would you suggest I accomplish this?

Thanks!

Brandoe85
08-18-2005, 11:42 PM
With the DISTINCT statement:

SELECT DISTINCT fldName FROM tblName


Good luck

atawmic
08-19-2005, 12:33 AM
Thanks a lot! Worked great!

Brandoe85
08-19-2005, 06:21 AM
You're welcome :)