Davina Davina - 3 months ago 10
MySQL Question

Dropdownlist php doesn't show data from mysql database

Here is my code for populating data into

dropdown
list from mysql database

<select name="robes">
<?php
$result = mysql_query("SELECT * FROM robes ORDER BY Classement ASC")or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$color = $row["color"];
?>
<option value="<? echo $row['Id_robe']; ?>"><? echo $color;?></option>
<?php
}?>
</select>


now my problem that there is no data shown and no error message also.

Answer

Can you please check if php short tag is enabled? Or Use full php tag like

<?php instead of <?