• 9
• 10
• 9
• 10
• 10

# A Turn-Timer

This topic is 3976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ok, heres the deal. I'm creating an online strategy that is based around turns. Turns are processed every 30-sec but I cant figure out how to get PHP to update ALL of the profiles at once. Can someone help me with a way to get the script to update all the profiles at once and not just one?

##### Share on other sites
Well, I don't know PHP, but whenever I need something to process everything, I just make sure they're all in a data structure of some type (linked list, for example), and have it go through them. A linked list would probably work for this, it should give you enough power to manipulate each player sufficiently, and gives you an easy way to run through every one. Since there won't ( I assume) be many players, the inefficiency of searching through it should be insugnificant. Not sure if this is what you need/if it will work for what you're doing, just my way of doing things.

##### Share on other sites
$result = mysql_query("SELECT * FROM profiles");while ($row = mysql_fetch_assoc($result)){ // your data is in an array in$row    mysql_query("UPDATE profiles SET junk = 'data', morejunk = 'more data' WHERE id = '" . \$row['id'] . "'");}

Assuming you're using mysql and your game is setup the way I think it is. You're not giving me much to go on.