I have a code that echo's whatever I have on my database. It works normally when using WiFi, but when I use cellular network on any phone or if I hotspot to my computer, it takes about 2 hours to echo the new information (Even if I refresh the page it does not change until after 2 hours or so).
Note: - I live in Egypt - I'm using Vodafone, and my friends use Etisalat (cell companies) and neither works properly. - I'm using Alwaysdata to host my mysql database
Note 2: - My brother lives in Italy and I asked him to check the site and refresh (using his cellular network) when I update the data in the database and it works perfectly for him.
What can I do so that it works here in Egypt because here is where the app I'm making is supposed to work
Update: This is my code trying to stop using cache
<?php
$server_name = "**********";
$server_username = "**********";
$server_password = "**********";
$dbName = "**********";
//$username = $_POST["usernamePost"];
//$password = $_POST["passwordPost"];
//Make the connection_aborted
$conn = new mysqli($server_name, $server_username, $server_password, $dbName);
//Check connection_aborted
if (!$conn)
{
die("Connection Failed. ". mysqli_connect_error());
}
else
{
//echo("Connection Success" . "<br>");
}
/*header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");*/
$sql = "SELECT id, gateName, Toggle FROM parking";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0)
{
//show data for each row
while ($row = mysqli_fetch_assoc($result))
{
echo "ID:" . $row['id'] . "|Gate Name:" . $row['gateName'] . "|Toggle:" . $row['Toggle'] . ";";
}
}
?>