Start Php updating a static variable

Php updating a static variable

PHP and My SQL is one of the most common stacks for web development, even in 2014.

As I mentioned previously, it's not good practice to keep those in the database connection script, especially if the PHP files are inside the document root (which means they will be accessible directly from the web).

A server error (malfunction or intentional) could cause those files to be displayed as text, revealing your database credentials to everyone viewing it at the time.

Let's create a simple configuration file, which looks like this: // Load configuration as an array.