I need your help to solve a silly problem. I have 2 tables in my database (contents and categories).
I have populated my MySQL table called "categories", and now I want to see in a form the old category stored in the database while I modify it to a new one.
Unfortunately what I wrote shows only the list of the categories get from the database table.
<select name="PostedCat">
<?php
$query_category = "SELECT * FROM categ";
$result_category = mysql_query($query_categ) or die (mysql_error());
while($categ = mysql_fetch_assoc($result_category)){
?>
<option value="<?php echo $categ['cat_title']; ?>" ><?php echo $categ['cat_title']; ?></option>
<?php
}
?>
</select>
With this code I can see the categories stored in the database, but how can I get the "old" selected one? The stored one?
Hope in some help, but I'm blind at the moment.
Thank you in advance.