Reputation Activity
-
Avera got a reaction from webdeveloper93 in FunctionsThe global keyword is evil it allows people to do some extremely sloppy programming.
You should build your code into a class.
Also, zend framework has a fully separated MVC. This allows you to logically separate your model (db) from your view (template/presentation layer).
$mysqli isn't NULL it's non-existent - it would throw a PHP Error NOTICE. Good advice on the Singleton class pattern. The singleton pattern is a favourite approach for DB connections.