I'm pulling a list of items from a database and displaying on a webpage. The items can be of different types and the attributes displayed depend on type. The query to get the items and the type-specific information joins four tables (items, items_categories, item_type_1, item_type_2).
The information in item_type_1 and item_type_2 is fairly static and needed only to display the full item listing - it is not a criteria in the query.
Would I be better off pregenerating the HTML for each item listing and saving in separate files? The query would join the tables items and items_categories to get the ids of the items and the script would include the appropriate listing files. As well as simplyfing the current query, I could add more item_type_ subtables if needed with no further overhead.
Alternatively, I could make a slight change to the database (and lose some normalisation) so that I could pull all the data required for an item listing from the items and items_categories tables. Would this be a better way to go?
Thanks
Liz