Once we have created the database in our server, the following step is to connect to the database from a PHP page. To this end, PHP provides us with a series of statements to access MySQL databases.
By executing the statement mysql_connect, we are creating a link between the database and the PHP page, this link will be used later in the queries we make to the database.
Finally, once we have stopped using the link to the database, we release it with the statement mysql_close so the connection does not remain busy.