June 2017
Intermediate to advanced
536 pages
9h 49m
English
We can either use the MySQLi functions or classes to interact with MySQL. In the spirit of OOP, we will use the class approach for all of our examples. Using the mysqli class, we can establish a MySQL connection from PHP, as follows:
$mysqli = new mysqli('127.0.0.1', 'root', 'mL08e!Tq', 'sakila');
This single line expression will look for MySQL on the 127.0.0.1 host and try to connect to its sakila database using the root username and mL08e!Tq as its password.
Read now
Unlock full access