Modern Merlin Posted July 24, 2008 Share Posted July 24, 2008 I need to write a script that I have never attempted before and would love it if someone could point me in the right direction... Basically, it would be like this. User signs up for an account and then creates a sub account. The moment the user creates a sub account that time is saved to the Database (even when they are not logged in the script should still be running). Every time the script is run it adds a number to another number in the table and saves the new number to the Database until that number reaches a set number. Once it reaches that number the script should still check every 10 minutes to see if the number has gone below the set number and if so start adding again. Thanks! MM Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/ Share on other sites More sharing options...
DarkWater Posted July 24, 2008 Share Posted July 24, 2008 Not quite sure I understand you. "the script should still be running" "every time the script is run" Please clarify. Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-598592 Share on other sites More sharing options...
.josh Posted July 26, 2008 Share Posted July 26, 2008 yeah...you're going to have to be more specific here. For instance, you say you want it to be "running" even if the user isn't logged in, but then you say that you want some value in a table to be incremented whenever some script is run. Is this the login script, as in, every time the user logs in, you want a value in a table incremented? If so, I don't really see why you would need it to be "continually running." Or are other users somehow able to increment this user's number? Or is this number even associated to a specific user? How is the number supposed to go down? Do you want the script itself to increment the number every x amount of time and then the number is decreased based on some action by the user? Come on man, we aren't psychic. You need to be very detailed even providing examples. Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-600435 Share on other sites More sharing options...
MasterACE14 Posted July 27, 2008 Share Posted July 27, 2008 your talking about obsessive cron use? maybe... Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-600774 Share on other sites More sharing options...
fiezach Posted August 13, 2008 Share Posted August 13, 2008 ok i don't know if this goes with it but could someone solve this for me for ($x=0; $x<=$number; $x++) { echo $x; } Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-615174 Share on other sites More sharing options...
corbin Posted August 13, 2008 Share Posted August 13, 2008 "could someone solve this for me for ($x=0; $x<=$number; $x++) { echo $x; }" Google "php for syntax". Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-615261 Share on other sites More sharing options...
Barand Posted August 13, 2008 Share Posted August 13, 2008 I don't think basic addition is a qualification for the maths forum. Moving to PHP Help. Quote Link to comment https://forums.phpfreaks.com/topic/116362-help-php-script-that-updates-a-row-in-a-table-based-on-time-passed/#findComment-615859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.