Displaying a Query in a Pulldown Menu + More Advanced filter
Posted: Mon Dec 06, 2004 2:53 pm
I have a pulldown menu being dynamically populated by a database
I want to be able to just display unique values (hard to explain)
Basically, if I have a column "event" and in that "event" column I have the following values (christmas, thanksgiving, easter, christmas, easter)
In the pulldown I want to display...
Christmas
Easter
Thanksgiving
NOT -->
Christmas
Thanksgiving
Easter
Christmas
Easter
So, I need to filter out duplicate names for the "event" field, So when I make a selection from the pulldown, it sorts the database based on that event.
Hope this makes sense geniouses. You guys have answered questions Macromedia can't answer! Lets see about this one! haha.
Thanks All,
Adam[/php_man]
Code: Select all
<option value="">Choose a Beginning Date</option>
<?php
do {
?>
<option value="<?php echo $row_Date_Sorterї'event']?>"><?php echo $row_Date_Sorterї'event']?></option>
<?php
} while ($row_Date_Sorter = mysql_fetch_assoc($Date_Sorter));
$rows = mysql_num_rows($Date_Sorter);
if($rows > 0) {
mysql_data_seek($Date_Sorter, 0);
$row_Date_Sorter = mysql_fetch_assoc($Date_Sorter);
}
?>
</select>Basically, if I have a column "event" and in that "event" column I have the following values (christmas, thanksgiving, easter, christmas, easter)
In the pulldown I want to display...
Christmas
Easter
Thanksgiving
NOT -->
Christmas
Thanksgiving
Easter
Christmas
Easter
So, I need to filter out duplicate names for the "event" field, So when I make a selection from the pulldown, it sorts the database based on that event.
Hope this makes sense geniouses. You guys have answered questions Macromedia can't answer! Lets see about this one! haha.
Thanks All,
Adam[/php_man]