I'm working on a project at the moment where there are a couple pieces of information from the database that will be used in multiple locations throughout the site in a drop down selector. The list of information will not change very often.
My 2 lines of thinking out the solution for this are:
1) Query the database each time to retrieve the list into an array (it will be a single piece of data with it's associated id). Then compile that using a while (or for) loop into a series of <option> statements.
2) Use the form where the database would be edited from, and when the data is edited, THEN run the query, pass it through the while loop to construct the <option> statements, and then save that into a text file to use as an include where necessary in the other forms.
It's basically a list consisting of active and non-active records. The 2 options are to add a new record, or mark an old one inactive, then the lists would consist of ONLY active records and another consisting of ALL records. I have full control over the record edit form, so I could easily add some code to create the text file.
So, which is considered the "better" approach? Choice 1 would end up making numerous calls daily, retrieving the same list, while option 2 would only call it a few times a week when the active list is modified.