jack7076 Posted September 15, 2017 Share Posted September 15, 2017 I am creating a website which uses a mysql database. Which holds user information and there balance. When a user purchases tokens (via Stripe) They are redirected back to the account management page. I have checked stripe and they have confirmed the payment. I have checked the sql database and the token value has been added. But on the management page the token value is still the same. (cacheing has been disabled.) Here is the code: <?php $query = $conn->prepare("SELECT ID, username, fname, lname, email, tokens FROM `users` WHERE ID = ?"); $query->bind_param("s",$_SESSION['ID']); $query->execute(); $query->bind_result($ID, $username, $firstname, $lastname, $email, $tokens); $query->fetch(); $query->close(); ?> <p class="my-account-p-padded"> <br> Username: <?php echo $username; ?><br> First Name: <?php echo $firstname; ?><br> Last Name: <?php echo $lastname; ?><br> Account Tokens: <?php echo $tokens; ?> <a href="javascript:void(0)" onclick="showlightbox();" id="addmoretokensbtn">Add More</a><br> <span id="explain" style="display: none;">(Scroll Up to see screen)</span> </p> Screenshot of db: Attached. Screenshot of Page: Attached. Quote Link to comment https://forums.phpfreaks.com/topic/304988-sql-db-sending-old-results/ Share on other sites More sharing options...
Solution requinix Posted September 15, 2017 Solution Share Posted September 15, 2017 Add a little bit to the code: <?php $query = $conn->prepare("SELECT ID, username, fname, lname, email, tokens, NOW() FROM `users` WHERE ID = ?"); $query->bind_param("s",$_SESSION['ID']); $query->execute(); $query->bind_result($ID, $username, $firstname, $lastname, $email, $tokens, $now); $query->fetch(); $query->close(); ?> <p class="my-account-p-padded"> <br> Username: <?php echo $username; ?><br> First Name: <?php echo $firstname; ?><br> Last Name: <?php echo $lastname; ?><br> Account Tokens: <?php echo $tokens; ?> <a href="javascript:void(0)" onclick="showlightbox();" id="addmoretokensbtn">Add More</a><br> PHP Time: <?php echo date("Y-m-d H:i:s"); ?><br> DB Time: <?php echo $now; ?><br> <span id="explain" style="display: none;">(Scroll Up to see screen)</span> </p>Do you see the two times changing? Quote Link to comment https://forums.phpfreaks.com/topic/304988-sql-db-sending-old-results/#findComment-1551336 Share on other sites More sharing options...
jack7076 Posted September 15, 2017 Author Share Posted September 15, 2017 I see what you have changed and added them for administrators of the site turns out that opera has its own cacheing system and I can't find a way to disable it. requinixThank You. Quote Link to comment https://forums.phpfreaks.com/topic/304988-sql-db-sending-old-results/#findComment-1551338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.