I need an option in a html select field form, that has a title "No Category" below all of my other options imported from my mysql database.
$query = mysql_query("SELECT * FROM category ORDER BY id");
while($row = mysql_fetch_array($query)) {
$drop .= "<option>{$row['title']}</option>";
$drop .= "<option>No Category</option>";
}
//shortened html
echo "<select>{$drop}</select>";
Which is printing in the selection form:
category1
No Category
category2
No Category
ect..
As you can see, the "No Category" option is repeating after each title from the database.. When I take out the "." on either before the equal sign, its only printing one mysql category title...
I've look everywhere but can't understand how this works