Re: Problem whit retrieving data from MySQL
Posted: Thu Mar 18, 2010 4:52 am
all you need to do is write your script that you want to run every minute/hour/second to increment people's resources, and slap a meta-refresh tag on the end of it
so it'll look like this
Then, when you want the 'server' to have the game active, load up that script in a browser somewhere, and leave it to run.
Like i said, it's totally barbaric in theory but i imagine it's one of your only options
or you could give this a read
http://dev.mysql.com/tech-resources/art ... nts.html#1
so it'll look like this
Code: Select all
<?php
//MYSQL update statement here to give resources to all your players
//Include all the maths of iron mine levels etc...
?>
<!-- Add this bit of HTML on the end of your script -->
<meta http-equiv="refresh" content="60">
Then, when you want the 'server' to have the game active, load up that script in a browser somewhere, and leave it to run.
Like i said, it's totally barbaric in theory but i imagine it's one of your only options
or you could give this a read
http://dev.mysql.com/tech-resources/art ... nts.html#1