I have a website that shows Database data for the Page.
If this data is changed in the database, it will automatically show it on the page, without refreshing the page, just refresh the code in real time.
I use id = 'refresh' for this equation, but .. since I do not know how to do ...
How do I do this?
$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>";
}