I'm trying to create a dropdown list of my product type from the database, I'm using this code from How to populate HTML dropdown list with values from database.
<select name="product_type">
<?php
include('include/conn.php');
$sql = mysql_query("SELECT product_type FROM produk2");
while ($row = mysql_fetch_array($sql)){
echo "<option value=\"product_type1\">" . $row['product_type'] . "</option>";
}
?>
</select>
I'm going to add this in my search engine, but the dropdown from that code making it read all data from product_type. Is it possible to create the dropdown without the same product_type twice?