QUOTE(NickyBoy @ 30 Jul, 2007 - 03:54 AM)

Hello!
First of all I like announce you that i might do some mistakes in spelling.
I'm learning PHP,MySql,Javascript,CSS and html.... And I wanna' make a browser game like anow2.
...but I have some questions.
1)Let's say my city have some resources and for example 1200 WOOD. And the villagers consume 60 wood/hour. How can I modify my database every second for all the players. It will take too long? Is there another way?
I have tried with php timer and... it dose'nt work.
2)I have read on other forums that the security is a big problem.
3)MySql is good enouth for suporting plenty of users?
10x,
NickyBoy
Yeah that is a bit of the tricky part but what is usually done is the setup of a what is known as a "cron job" (chronological job) on the server. It is a scheduled process which executes a script every so many seconds, minutes, hours, days etc.
For your example you would setup a script that calculates the rate of wood consumption (based on population, mills you have built etc) and then deduct that from their total. Now unlike desktop games where you could update every second or so, due to the work that may be involved to update hundreds and thousands of users this would be impractical. So what you would do is instead maybe set the schedule every 5 minutes or maybe every 30 minutes. If they are using 60 wood/hour, you may need to design the game so that your job runs every 30 minutes and subtracts 30 wood from the account.
This limitation is why you find many online games work on the idea of a "game day" where a game day may be an hour in real life. Their job will then run every hour and update gold, wood, stone, etc. I strongly recommend never setting up the scheduled job less than maybe 5 minutes because you will run into scalability issues later if your game becomes quite popular.
Below is a few links to an explanation of what cron jobs are (I am probably going to get yelled out by the *nix crowd for such simple sites but oh well). I hope they help push you into the right direction.
Cron job basicsCron help siteSetting up crons (link to windows version as well)