OK I have created an azure virtual machine with a web app. I also created an azure server, and a database to go with the server. All are connected and working. I have even ran queries on the database and linked a github repository.
First I have configured everything with phpmyadmin on a local xampp server. On the xampp server everything with the website is working fine, however when I change the value of the server host, user, pass, and database I receive an sql error when attempting to connect to the database.
Bellow is the code I use to connect to the database.
Every time I run this code I receive the error Failed to connect to MySQL:
MySQL server has gone away
$db = mysqli_init();
mysqli_real_connect($db, $sname, $dbUser, $dbpass, $dbName, 1433);
if (mysqli_connect_errno($db)) {
die('Failed to connect to MySQL: '.mysqli_connect_error());
}