I'm looking at
MySQL Control Flow Functions right now and am very interested in
IFNULL.
I'm very sure I can achieve this using
Vlad's MySQL subselect somehow...I just have to figure out how to construct it all.
So the conceptual logic I am attempting to do with MySQL is...
IF (yes)
{
JOIN to pages table to retrieve the list of pages to be used for the index
if the result ISNULL return something any way!
}
ELSE return nothing (default/fine)
The PHP logic is simple...
1.) If there are no rows the section does not exist.
2.) If there is data...
2-A.) If the return data is not the "section exists but not empty" value spit out the index in a loop.
2-B.) Else show the section information but that there are no pages.
I'm pretty sure this can be done...it's a matter of learning the language a little more.
The issue I want to avoid is not returning any data if the section exists but it empty...then it will show it as not existing even though it
does exist; that is what I'm trying to avoid through only a single query.