i have done this dropdown menu which takes the distinct POS from my database. and it is displayed out as how the attached picture shows.
however i want the php dropdown menu to be placed in the html table instead. as shown in the 2nd picture. so i can update the particular field. but i don't know how to do it, do help! :)
<td><input type="text" name="POS" placeholder="POS" required />
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('ishop');
$sql = "SELECT DISTINCT POS FROM tbl_st";
$result = mysql_query($sql);
echo "<select name='POS'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['POS'] ."'>" . $row['POS'] ."</option>";
}
echo "</select>";
?>
</td>
</tr>
try this
<td><input type="text" name="POS" placeholder="POS" required />
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('ishop');
$sql = "SELECT DISTINCT POS FROM tbl_st";
$result = mysql_query($sql);
echo "<select name='POS'>";
while ($row = mysql_fetch_array($result))
{
?>
<option value="<?php echo $row['POS'] ?>"><?php echo $row['POS'] ?></option>;
<?php
}
echo "</select>";
?>
</td>