I've got this running under XAMPP and the Plays Today: always stay at "0" ?
Set the time zone - Still doesn't count anything?
$db->query('UPDATE fas_gamestats SET total_played = total_played + 1,played_today = played_today + 1'); // adds a play to the total plays and played today stats
$db->query('UPDATE fas_gamestats SET total_played = total_played + 1');$db->query('UPDATE fas_gamestats SET played_today = played_today + 1');
This is the line that updates Total plays and Plays todayCode: [Select]$db->query('UPDATE fas_gamestats SET total_played = total_played + 1,played_today = played_today + 1'); // adds a play to the total plays and played today statsIt might have to do 2 query's for XAMPP, not sure as i test my code on live serversCode: [Select]$db->query('UPDATE fas_gamestats SET total_played = total_played + 1');$db->query('UPDATE fas_gamestats SET played_today = played_today + 1'); The time zone is for the reset of Plays Today only, I can verify that the top line works.
I was just thinking that if it wasn't set that it could have been resetting the count every time the page reloads undoing any adding to it
Quote from: Dillon on October 25, 2014, 12:38:43 AMI was just thinking that if it wasn't set that it could have been resetting the count every time the page reloads undoing any adding to itI split the two queries to test the strings also.But You're right on the reset, The reset happens on all refreshes of the play page.I actually use something different with UNIX-Time that does Today(Last 24hrs), Weekly(Last seven days) and could do monthly and yearly too. The only drawback is that it only counts each game-played once per 24hrs.So the margin of error would be what! 3% chance that more than one person plays the same game on the same day?I can live with that...