I use somehting like this
$sql = mysql_query("SELECT DISTINCT id, name FROM products");
while($row = mysql_fetch_assoc($sql))
{
$dd .= "<option value='{$row['id']}'>{$row['name']}</option>";
}
Then just echo out $dd in your html.
<select name="products" style="width: 222px;">
<? echo $dd; ?>
</select>