So I have a number in the MYSQL table which is displayed on the screen using the function:
function getWinNumber($db) {
$user = getProfileInfoFor($_SESSION['id'], $db);
$winNumber = $user->number;
return $winNumber;
}
Then after some user actions that value changes in the DB and I want to update it in front-end when they close a foundation modal:
$(document).on('close.fndtn.reveal', '#ex6-4', function () {
$('.number').html("<?php echo getWinNumber($db);?>");
});
The problem is that even though the code works, and I can clearly see in the DB that the value has changed before I close the modal, the value being pulled is still the old one. Why is that?
If I put anything else in there like:
$(document).on('close.fndtn.reveal', '#ex6-4', function () {
$('.number').html("test");
});
it works. It updates when I close the modal.