Agile Application with php & mySQL
I’m working on a website system an facing this problem where and how to store my configurations in the database. So you want to store your configuration vars in a configuration table in the database, that’s great and fun to do too.
Why do it?
Your application becomes easier to update to a newer version, most of the time, when creating a newer version you will strip – change – add some variables for configurations, with a database it’s easier and you (or the admin) can change things on the fly.
How?
One or more tables like this:
Mysql table:
+------------------+
| config |
+------------------+
| id |
| name |
| value |
+------------------+
If you want you can add an selection column to get only the ones needed for that function but this is the best way when being in a development environment I think
webscriptz 20:39 on 28/03/2009 Permalink |
note that you can do this also with languages and it’s configurations. so:
languages with id – lang – status
status so you can have an active one to select with the WHERE attribute.
languagevalues: id – name – value – lang_id
lang_id is a foreign key in fact