This is a simple function that is getting the category name and id from the db.
function Get_all_cats()
{
$query = "SELECT * FROM cats ORDER BY id DESC";
$result = mysql_query($query) OR DIE ("Unable to get comments!");
where($row = mysql_fetch_array($result)) {
?><option value="<?php echo $row['id']; ?>"><?php echo $row['cat_name']; ?></option>
<?php
}
}
I want to be able to use this to create a drop down in the form to choose the category for a blog post. However this function has an error somewhere as it's causing a white screen. Am I missing it? Thanks for any help
Also how would i return this if it's a loop?