In this section, we will make a simple page to test PHP and MySQL with the following command:
sudo nano /var/www/html/hellodb.php
The following screenshot has the script that has the code to access the database, connect to the server, and get the data from it:
To test the page that we have made, type the IP address of your Raspberry Pi: http://192.168.1.105/hellodb.php. The page that appears is shown in the following screenshot, and you can now test that you can communicate between PHP and MySQL: