Hi Guys,
Can anyone give me advice on how to do this the best possible way:
Lets say i have a mySQL DB. It contains a table called genre. This table has 3 fields, they are genre_id, genre_parent and genre_name.
Here is an example of the DB and its contents:
genre_id | genre_parent | genre_name
1 0 Home
2 1 Action
3 1 Comedy
4 1 Drama
5 2 General
6 2 Classics
7 4 Television
What i am trying to do is extract the genre's top category and all it's associated sub categories into a drop down list.
Here is the code so far for this:
<?
$result1 = mysql_query("SELECT * FROM genre WHERE genre_parent='1'",$db);
while ($row1 = mysql_fetch_array($result1)) {
$genre_id = $row1["genre_id"];
$genre_parent = $row1["genre_parent"];
$genre_name = $row1["genre_name"];
?>
<option value="<? echo $genre_id ?>"><? echo $genre_name ?></option>
<?
}
?>
How can i get the drop down list to display as a breadcrumb?
For example:
Action > General
Action > Classics
Comedy
Drama > Television
Any ideas would be most welcome.
Cheers,
micmac