Initialise and connect to a database with mysqli

In phpMyAdmin there was no need to do anything to connect to the database – we simply clicked on the database and then on the table names to gain access to them. But to access the database through a browser, we have to connect to it first.