Hi, I'm working on dynamic navigation bar. Basically, here's what I have so far:
- User goes to index.php
- MySQL db is queried for the sectionID and sectionTitle (the title is what gets displayed in the nav bar, the ID becomes the key or the value - I can never remember the difference).
- The results of the query are listed in the nav bar.
- Once you click a link (ex, index.php?sectionID=2) then the subsections table is queried to find all the subsections that go until sectionID=2.
- The subsections for sectionID=2 are displayed under sectionID=2 in the nav bar.
So here's my problem:
Near the beginning of my script, I check to see if sectionID is set:
if(!$sectionID)
{
$sectionID = "";
}
If it's not set, then it's nothing and it will load whatever is on the index page. However, I keep getting an error that says that sectionID is an undefined variable. What's going on here?
Thanks!
Tommy