Add debug lines to your php code to get further details of the error.
You can also check your config.php to ensure that your db details are correctly specified. You will find these details on your database on how to connect with php
https://learn.microsoft.com/en-us/azure-data-studio/quickstart-sql-database
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards,
Abiola