Design Patterns for Web Programming in PHP
1. Singleton pattern
Name: Singleton
Problem: You need exactly one global instance of a class and a global point
of access to it.
Context: Any
Solution & Consequences: Make an encapsulated static variable holding
the single instance of a class. Provide a get-method that:
• has a static variable for holding the one and only instance
• instantiates the instance if it [...]
PHP mysql connection class
If you are pure PHP developer, and maybe creating your own classes framework, you can use PHP mysql connection class, include it in your created bootstrap or in the place you would like to connect to the database with require or include function , for example you stored the code in mysql.class.php file , require [...]
