Well, I am not sure but let me try to explain.
So I have a table (t1) with ~100 rows and in one of the column (c3)contains one of the following value (blank,type1,type2,type3...). So I would like the selection box to have the name of each item only once. What I have so far will populate all the items in the box.
[...]
// create SQL statement
$sql = "SELECT c3 FROM t1
ORDER BY c3 ASC";
// execute SQL query and get result
$sql_result = mysql_query($sql,$connection)
or die("Couldn't execute query."

;
// put data into drop-down list box
while ($row = mysql_fetch_array($sql_result)) {
$deviceid = $row["c3"];
$option_block .= "<OPTION value=\"$c3\">$c3</OPTION>";
}
Is this better?