Thanks for that, it makes a lot of sense nexocentric. One thing I would like to be aware of is avoiding this all over the shop: $mysqli = new mysqli("localhost", "my_user", "my_password", "world");
. I believe the term is OOP - how can I declare my DB connection once in the config and use it wherever on my website? Does a simple variable do the trick or do I turn that into a function and just delcare the function before any DB query?
As for:
One downfall of doing it this way is, every time you include config.php you will hit your database with a query.
Would it be better to define these once when the user logs in? Can you store an array as a session? Would this be the best method? I really appriciate your feedback so thank you.