I want to get a value from mysql populated in a drop down list. And then, the drop down list will be inserted in a table cell <td>
. But I don't know how to arrange the codes. The below code didn't work. I hope you can help me correct it.
<?php
include("connection.php");
?>
<?php
$result=mysql_query("SELECT * FROM peralatansukan");
$count=mysql_num_rows($result);
echo"<select name=dropdown value=''>Dropdown</option>";
echo "<table width='50%' border='1'>";
echo"<tr>";
echo"<td align='center'><b><font color='black'>No.</font></b></td>";
echo"<td align='center'><b><font color='black'>Peralatan Sukan</font></b>
</td>";
echo"<td align='center'><b><font color='black'>Kuantiti</font></b></td>";
echo"</tr>";
if($count==0){
echo "no record found";
}
else {
while($row=mysql_fetch_array($result)){
echo "<tr>";
echo "<td align='center'><font color='black'>".$row["no"]."</font>
</td>";
echo "<td align='center'><font
color='black'>".$row["peralatansukan"]."</font></td>";
echo "<td align='center'>"."<option value=$row[kuantiti]></option>"."
</td>";
}
echo "</select>";
}
?>