Page 1 of 1

[SOLVED] Limit DATE to 1 instance in dropdown list/menu

Posted: Sun Aug 15, 2004 11:34 am
by cdickson
I'm working on an administrative area where the client can access order information placed online.

One of the selections is to view orders by date. If there are multiple orders for a given date, how do I limit each date to appearing only once?

My current code - which lists the same date multiple times - is:

Code: Select all

<select name="selectDate">
<?php
do {  
?>
<option value="<?php echo $row3['order_date']?>"><?php echo $row3['order_date']?></option>
<?php
} while ($row3 = mysql_fetch_assoc($result3));
  $rows = mysql_num_rows($result3);
  if($rows > 0) {
      mysql_data_seek($result3, 0);
	  $row3 = mysql_fetch_assoc($result3);
  }
?>
</select>

Posted: Sun Aug 15, 2004 1:06 pm
by hawleyjr

Code: Select all

<?php
$qry = "Select distinct(order_date),* from table where...";
?>

Posted: Sun Aug 15, 2004 1:37 pm
by cdickson
Thanks hawley!
That did it! :D