Page 1 of 1

identical data from database outputted only once?

Posted: Thu May 26, 2005 9:20 am
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

Posted: Thu May 26, 2005 9:30 am
by hongco
use GROUP BY

Posted: Thu May 26, 2005 9:31 am
by soianyc
cool thanks. Sorry for the dumb question