Connecting to MySQL
Connecting to MySQL
In order to access the data in the MYSQL database, first we need to connect to the database. Now, there are two types of approaches when connecting to the MySQL server.
- MySQLi Object-Oriented Method
- MySQLi Procedural Method
Connecting to Database using the MySQLi Object-Oriented Method
Connecting to Database using the MySQLi Procedural Method
Closing the Connection
We can close the connection with the following code.