use a while loop to loop thru the recordsets returned from sql query and echo each row into the option of a select tag, refer:
populate-drop-down-list-from-database-using-mysqli-prepared-statements[
^]
+++++++++++++++++++++++++[round 2]
How do you construct dropdownlist in html? see example:
<select>
<option value="1">pencil</option>
<option value="2">eraser</option>
<option value="3">paper</option>
</select>
So in your php script, you have to loop to populate the options from the recordset retrieved from the database, so use while loop, example:
= mysqli_fetch_array($sres)){
?
<option value="<?php echo $row['product_code'] ?>">
</option>
You php script will interwind with html to create the html output of the select dropdownlist. You got to have a good knowledge of html first so that you know how to construct them using php.