0
I have a website where shows data from Database to Page.
If these data are changed in the database, automatically it will show them on the page, without refreshing the page, just refresh the code in real time.
I use id='refresh' for such an equation, but.. since I don’t know how to do it...
How do I do that?
$steamID = $_SESSION['steamid'];
$db = mysqli_connect($host, $username, $password, $dbname );
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$getC = mysqli_query($db,"SELECT credits, level, exp FROM users_steam WHERE steamid ='$steamID' ");
while($row = mysqli_fetch_array($getC))
{
$exp = $row['exp'];
$lvl = $row['level'];
/* if($lvl == 100 && ($exp == 0)) {
$confirm = '';
} else {
$confirm = ' <span class="levels"> Exp </span>'. $exp;
}*/
echo "<li><a href='buy.php' alt='Silver Coins' id='refresh'><span class='currency-w'>" . number_format($row['credits'],0) . "</a></span></li>";
echo "<li><a href='profile.php'><span id='levels' class='levels'>level </span>" . $row['level'] . "</a></li>";
echo "<li></li>";
}