Agile Application with php & mySQL

Written on 28/03/2009 – 20:35 | by webscriptz |

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


related post

  1. One Response to “Agile Application with php & mySQL”

  2. By webscriptz on Mar 28, 2009 | Reply

    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

Post a Comment

About Me

Here I'll share my knowledge, discovery and experience related to my hobby and work. Most articles on this site are related to blog design, short reviews, tips and make money online. More

Find entries :