I think I've finished moving the more common functions into a single central file. Now I just need to adapt the code so that it will be able to connect to the database wherever it is. This will help when I upload the website - I won't have to modify the code so that it looks for the correct database.
"Prepare for an oblivion for which there is no preparation." - O'Malley (Red Vs Blue)