Forum Moderators: coopster
function listGenres() {
$query = mysql_query("SELECT * FROM category ORDER BY name ASC");
while($row = mysql_fetch_array($query)) {
$id = $row['id'];
$name = $row['name'];
return "<option value=\"$id\">$name</option>\n";
}
}$listGenres = listGenres();
[us3.php.net...]
try this
function listGenres() {
$query = mysql_query("SELECT * FROM category ORDER BY name ASC");$option_rows = '';
while($row = mysql_fetch_array($query)) {
$option_rows .= "<option value=\"$row[id]\">$row[name]</option>\n";
}
if (!empty($option_rows)) {
return "$option_rows";
} else {
return false;
}
}