[thelist] PHP/MySQL get unique rows from the table

Nan nan at heritageconcord.org
Mon Jul 25 14:07:41 CDT 2005

hello Evolters,

I have a database table with events in it, I have to create a drop down box
so users can choose an event by the date, and show all events that happen on
that date. So I am selecting the start_date from the table to put in the
drop down box since that way you can only chose a date with events that
happen on that day, but there will be multiple events on the same date, and
I only want to show each date once. I googled for this, but am not sure how
to word it, I used things like --------select unique row----------------but
didn't get an answer to this question. From what I found, this might involve
a subquery, but I have never used one and didn't understand the example. Can
someone please explain to me how to do this? I have a feeling there is some
elegant short and simple solution to this.

I have asked a lot of dumb questions lately, so I will pay with a tip:

<tip> when debugging code by using echo statements, include the line number
and document, such as:
echo $foo." on line 1355 of class_events.php";
This will help you remember where you put it.


More information about the thelist mailing list