Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how to update db every 25mins
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to update db every 25mins

 Post Reply Post Reply Page  <12
Author
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2004 at 1:35pm
what i needed to do was give everyone in the db (X) about of credits per/ so many mins...  so what i am gonna do is on the home page when they log in...i will do a date/time stamp and add it to the db and then add a include file on every page that checks the time and updates the db with a new time ever (X) about of mins and then i will use that to add the credits... unless there is a better way LOL...im all ears ;)
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2004 at 2:35pm
are you using Access or SQL Server?
SQL Server has a scheduler
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2004 at 2:57pm

access...i have never used sql server

Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2004 at 7:04pm

bump*

i am not sure if this is gonna work...do you have any other ideas??

Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2004 at 7:44pm
Well, you only need to update credits everytime someone comes on the site.  This isn't probably very efficient, but it'll work for a small number of users.

In your users table, have 3 fields for each user:
 - Sign up date
 - Credits
 - Credit_accounted_for

Every page view the user does, calculate how many credits they should have.  If this is different than credit_accounted_for, then add the difference to credits field, and set credit_accounted_for to the new value.

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2004 at 7:54pm

Tou can use Session_OnStart sub in global.asa to check if it's time to run a script. The advantage is that it doesn't check for the time eerytime the home page is visited, but everytime someone visits the site. For some time periods though, you may have no one starting sessions.

If the script absolutely has to run at specified times, the best way is to either go with a host who has some in-house scheduling component, or drop a couple of bucks a month on a unix account with crontab capability. You can use cron to run the Lynx text browser on unix that runs an asp script on your windows account.

There was discussion about something similar in this thread - http://forums.webwiz.net/forum_posts.asp?TID=89 23&PN=0&TPN=2


Lead me not into temptation... I know the short cut, follow me.
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2004 at 9:40pm
what i did was added 2 columns to the db...on that is the julian date and the other is the hour of the last update.  then i take and compair todays julian date and the hour...and i can use that do update the credits per user...i added a include file on all my pages so that it always does the check...
Back to Top
asp what that?? View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 08 November 2003
Location: United States
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote asp what that?? Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2009 at 9:10pm
hey guys its been a while but I'm back!
New Millennium Network Services
http://www.NMNetworkServices.com
My Email
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.