Thank you for getting back to me. Your reply raises other questions since I am still very new to PHP.
The reason I used the foreach statement was because I figured out that if I use that, it will leave out a column that is null for the entire category. For instance, one category is going to be restauarants. If a user selects that, a column called cuisine will be dispalyed. Another category is Houses of Worship, if a user selects that, Denomination will be displayed. Now obviously, I do not want Denomination listed when restaurants is selected and likewise, I do not want cuisine if Houses of Worship is selected. When I used the above code, it left out blank columns but the trade off was, I had the ID column and the Category Column displayed.
Also, I wasn’t sure how to have the columns appear that way with headers and omit the blank columns. I figured I could hard code them in but then again I thought I would be stuck with having the Denomination column appear under restaurants. Is there a way to suppress blank columns, Columns I don’t want the user to see and place the column headings on with the script commands I am using or do I have to get much more detailed? LIke I said I am very new to PHP and kind of blindly stumbling through this.