The purpose of this tutorial is to show you how I use PHP's OOP MySQLi in larger projects. For larger projects, I like to separate out the connection to the MySQLi in another file. We'll call the class db_connect.php since that's what most books seem to reference it as. db_connect.php -- I'll take it another step further and create a class that's going to make it simple for me to call other classes. I'll call it ClassInitialization. This class will only contain one method className() and it's purpose will be to initialize other classes. class_initialization.php -- As is evident from the above code, the className() method requires 2 parameters: the name of the class that you want initialized and an optional file location parameter. It'll then require_once() the file and return the new ClassName object. To put the 2 classes that we've created together, you'll need to create a third class that will do something spe...
The True purpose of education is to make minds, not careers.