The application works locally but not on InfinityFree. Please check if there are any permission issues with my MySQL user account or if the password needs resetting.)
Try using this to connect to your DB (replace templates with your real credentials):
<?php
// Database configuration (Remove the brackets, fill in the information in the "")
$servername = "[Replace with DB Servername, like 100.epizy.com for example]";
$username = "[Replace with Username, like if0_00000000 for example]";
$password = "[Replace with Password]";
$dbname = "[Replace with DB name]";
// Connect to the database
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
Also, make sure to double-check your credentials, sometimes when copying the text a trailing space may be included.
(A Leader has made this topic hidden from the public, and a Moderator will come by and edit your post soon.)