identical data from database outputted only once?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
soianyc
Forum Commoner
Posts: 61
Joined: Wed Mar 30, 2005 2:48 pm
Location: NY

identical data from database outputted only once?

Post by soianyc »

I didnt know how to word this question but this is what im trying to do.

Say you have 10 items in an sql database. 5 items have a description of "foo" and 5 items have a description of "bar". Is there a way to look at the entire database and output "foo" and "bar" but only ONE time and not multiple times. I would be using something like this to make a menu.

I was looking around for a php function for this but i didnt quite know how to word the question. Your replys here are always helpful!!!


-soianyc
hongco
Forum Contributor
Posts: 186
Joined: Sun Feb 20, 2005 2:49 pm

Post by hongco »

use GROUP BY
User avatar
soianyc
Forum Commoner
Posts: 61
Joined: Wed Mar 30, 2005 2:48 pm
Location: NY

Post by soianyc »

cool thanks. Sorry for the dumb question
Post Reply