Jump to content

Display Unique values in a drop down Menu


kayne31

Recommended Posts

Hello,

 

I am new to the forums scene so I appoligise if what I post is incorrect or in the wrong place but I hope someone can help me.

 

I am busy with creating a catalog page for a friend and I have created a drop down menu to select the product from I am filling this menu as follows:

 

<option value="<?php echo $row_Recordset1['Make']?>"><?php echo $row_Recordset1['Make']?></option>

          <?php

} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));

  $rows = mysql_num_rows($Recordset1);

  if($rows > 0) {

      mysql_data_seek($Recordset1, 0);

  $row_Recordset1 = mysql_fetch_assoc($Recordset1);

  }

?>

 

However this is only giving me all the values from make but I only want to display unique values How can I do this?

 

Thanks in advance

Hi,

 

See said I was new to this sort of thing is this what you needed to see?

 

mysql_select_db($database_*, $*);

$query_Recordset1 = "SELECT Make FROM Products ORDER BY Make ASC";

$Recordset1 = mysql_query($query_Recordset1, $*) or die(mysql_error());

$row_Recordset1 = mysql_fetch_assoc($Recordset1);

$totalRows_Recordset1 = mysql_num_rows($Recordset1);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.