I am having trouble with a simple problem. I googled it and found so many resource but nothing is useful in my perspective.
Here I ran a query and output it as a select menu. But first row of the value isn't show up.
<?php
$query = mysql_query("SELECT * FROM `subcategory` ORDER BY `Category_id`");
while($row = mysql_fetch_array($query)){
$subcategory_title = $row['Subcategory_name'];
$subcategory_id = $row['Subcategory_id'];
$subcategory_id = $subcategory_id*10;
$selectMenu .= "<option value='$subcategory_id'>$subcategory_title</option>";
}
?>
and output is in the
<select name='' class=''>
<option disabled='disabled'>Choose a Topic</option>
<?php echo $selectMenu; ?>
</select>
I am echo out the $subcategory_title and $subcategory_id, here first row value show up whether in list menu it is not. Same code in another script works fine. I don't understand. What is the problem?