/    Sign up×
Community /Pin to ProfileBookmark

php cron job, or is there an effecient method?

so i want to create a tool on my site that allows users, if 5 users are logged on with unique IPs, to post up a request to play 5 other people ~

so for the verification, i would just store the IP in the database as they login and when they logout, delete it from the database ~

anyways, so the tool that allows people to look for people to play against would check if the team id tied to the user, and see if there are 5 unique ip address. then i would allow them to do the posting

so the problem is how do i do the “update” of the page, meaning people are going to be posting and deleting their requests for players, and maybe someone logs out and so only 4 people are logged in from that team with the same ip, i would want them to be “booted” out of the service with some warning saying 5 people are necessary.

would i do a cron job that updates every minute checking if the people using the tool have 5 logged on? wouldn’t kill my database? is there any more effecient way to do so?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@scragarOct 10.2007 — I think if the ocasional page of the users request checks if they are in a team with insufficient members then remove the team, otherwise let it go on. This would reduce load by dividing the usage, but you have to be careful that you don't run it too often or your pages will start running slow.
Copy linkTweet thisAlerts:
@ixxalnxxiauthorOct 11.2007 — so the page, say its findscrim.php, people use it to find the opponents team... should i just have the page refresh every 15 seconds with an optional link to refresh the page?

and every refresh, i'll do the verification?
Copy linkTweet thisAlerts:
@ixxalnxxiauthorOct 11.2007 — the similar thing i am aiming for is how on gmail, if anyone's ever used, the chat window refreshes when 2 people are using the gmail chat ~
×

Success!

Help @ixxalnxxi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...