Sorry to ask what I assume is a fairly simple question. Okay, so I'm trying to follow https://www.skysilk.com/blog/2018/how-to-connect-an-android-app-to-a-mysql-database/, a tutorial on how to do, well, exactly what it says. However, my PHP code, when I test it the way they say I should, by loading up "herokuserverbeingused.com/phpcode.php" in my browser, instead of getting the echo it says I should, I instead get nothing. Here's my code, it's literally just the code from the tutorial modified slightly
<?php
//borrowing from don't forget to credit https://www.skysilk.com/blog/2018/how-to-connect-an-android-app-to-a-mysql-database/
$con=mysqli_connect("a heroku server.net","nope","sorry","very secret");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "SELECT * FROM players";
// Confirm there are results
if ($result = mysqli_query($con, $sql))
{
// We have results, create an array to hold the results
// and an array to hold the data
$resultArray = array();
$tempArray = array();
// Loop through each result
while($row = $result->fetch_object())
{
// Add each result into the results array
$tempArray = $row;
array_push($resultArray, $tempArray);
}
// Encode the array to JSON and output the results
echo json_encode($resultArray);
}
// Close connections
mysqli_close($con);
?>
I'm using Heroku to host everything because my professor said that would be a good idea, is that what's causing the problem?