To store in an array or SQL database, that is the question.
Posted: Wed Feb 25, 2009 8:42 pm
Hi,
I have a problem. I am writing a web site that has one index file, then based on the "module name" I pass it, it will call a function that will match up the module name and return an array consisting of the page title, description, and filename for the content to be included. My problem is that my "coder conscience" is telling me that I should not store this data in an array, because it's hard coded into the script, and that I should store it in a MySQL table. However, this of course will inevitably use more resources if the database has to be queried every single time a user visits a page to determine this data.
Is either way horribly bad design?
Thanks.
I have a problem. I am writing a web site that has one index file, then based on the "module name" I pass it, it will call a function that will match up the module name and return an array consisting of the page title, description, and filename for the content to be included. My problem is that my "coder conscience" is telling me that I should not store this data in an array, because it's hard coded into the script, and that I should store it in a MySQL table. However, this of course will inevitably use more resources if the database has to be queried every single time a user visits a page to determine this data.
Is either way horribly bad design?
Thanks.