Download to read offline



This document provides an example of an object-oriented approach to connecting to a MySQL database using mysqli in PHP. It defines a db_connection class that extends mysqli and handles the connection in its constructor. The constructor calls the parent mysqli constructor, checks for connection errors, and allows instantiating a db object connected to the database for subsequent queries.