Dynamically Create and Manage Application variables and set them on the fly in your applications. This tutorial will work best for situations that involve reusing the same application architecture for multiple sites, if application variables are changed often or if application variables wish to be changed without going into the code.
When it comes to the question of "Is the record in the database, if so, update, else insert", there has to be an easy way do write it with less code.