Connecting to a MySQL Database

MySQLi

We will be using mysqli (or MySQL improved extension) 

Benefits over the previous MySQL:

Connecting to a Database - Example

The php code below will connect to a server called localhost and connect to the database called AH_phpskills. It will use the username of root with no password

If the connection fails for any reason then an error description is displayed using the mysqli_connect_error() function and the die() function stops the script from running.