It is currently August 19, 2018, 12:47:27 PM




Post new topic Reply to topic  [ 5 posts ] 
 y00 php/mysql issue 
Author Message
Tester
User avatar

Joined: March 30, 2006, 07:13:19 PM
Posts: 2232
Location: Houten, Netherlands
Character: TrevoriuS
Clan: Dwarfhood
Post y00 php/mysql issue
Ye me and soem pal from school are escaping reality with a lil' browser based minigame >< But we have a problem. We want to do something like this:

[Click button]: change int varialbe instantly; place timer for countdown + cancel button
timer for countdown is just a javascript with input variables by checking page loading moment and timer goal moment
when cancel is clicked: variable must be changed back (old variable doesnt need to be changed cause its jsut put the other way around through a formula)
but if cancel is not clicked; another integer must get something added up to. So what if the user logs out - the script msut still be executed.

The same goes for adding money-ish every hour, even when the player is not online. How is it possible to either calculate such things when the player logs in again; or way more easily, execute scripts even when the player is not online (so on the badckground; possibly for the entier database).

using apache & mysql here.

_________________
My fairly outdated portfolio
Art is about beauty, nor originality. If quality can't be indicated, it's not abstract nor original, its more likely bad.
Philosophy


December 10, 2007, 08:57:33 PM
Profile
Tester

Joined: April 14, 2007, 07:21:32 PM
Posts: 2159
Clan: Order of the Beetle
Post Re: y00 php/mysql issue
I suggest you ask K-Zodron, he knows everything and perhaps even more concerning PHP and MySQL, I'll forward this to him.

_________________
OBA OBA OBA


December 10, 2007, 08:59:58 PM
Profile
Tester
User avatar

Joined: May 19, 2007, 01:05:32 AM
Posts: 79
Location: Finland
Post Re: y00 php/mysql issue
The easiest way to do something while the user is offline is to store time variables. You simply store the time when the user last was updated, and then use that variable to figure out how much time has passed when updating the next time.

If you absolutely have to do something lets say every hour, you could use some kind of cronjobs. I suggest trying out http://www.webcron.org (that's what I used for MarketCrash job updating)

I don't understand the cancel button thingy you explained in the beginning of the post fully :P

_________________
Zezenia Online


December 10, 2007, 09:09:26 PM
Profile
Tester
User avatar

Joined: March 30, 2006, 07:13:19 PM
Posts: 2232
Location: Houten, Netherlands
Character: TrevoriuS
Clan: Dwarfhood
Post Re: y00 php/mysql issue
Wel say I but a training lesson in skill X
And I decide to stop the training; while I didnt get the skill yet - I dont learn a thing, and get my money back
Thus CANCel ;) Thanks alot of the WebCron thingy - im reading it now

_________________
My fairly outdated portfolio
Art is about beauty, nor originality. If quality can't be indicated, it's not abstract nor original, its more likely bad.
Philosophy


December 10, 2007, 09:13:30 PM
Profile
Tester
User avatar

Joined: May 19, 2007, 01:05:32 AM
Posts: 79
Location: Finland
Post Re: y00 php/mysql issue
Well..hmm...a cancel button is pressed and X happens...doesn't sound like a hard feature to me? Maybe I misundestood your point :P

Code:
<form action="randompage.php">
<input type="submit" value="Cancel" />
</form>

--------- randompage.php ----------

<?php
    CancelJob();
?>

_________________
Zezenia Online


December 10, 2007, 09:26:08 PM
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.