Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Resetting a Demo Automatically
Old 09-13-2010, 09:11 PM Resetting a Demo Automatically
Banned

Posts: 39
Trades: 0
I have a php script that I am releasing free and I want to setup a demo of it on my website. However, I would like for the demo to reset every 4 hours.

Here is how I would prefer the reset to work. Everything will be auto deleted from the database and then the cron will access a specified .sql file to restore the database from. For example it will take the file "http://www.mywebsite.com/backup.sql"

How would I set something like this up? I have been searching for code or a script that does this and can't find anything.
CyberWizard is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-14-2010, 03:28 PM Re: Resetting a Demo Automatically
Novice Talker

Posts: 7
Name: Iman Ghasrfakhri
Trades: 0
I'm not sure if there is a special script to do that but why don't you create the script your self? you can run your script by cron every 4 hours so it reset every thing to default. (actually I think I didn't realized your exact problem!)
__________________

Please login or register to view this content. Registration is FREE
, the first Persian freelancing website.
Quote:
Who can, do; who can't, teach!
Perfect Support, reasonable prices just in
Please login or register to view this content. Registration is FREE
. Shared, Dedicated, Cloud Hosting.
imangh is offline
Reply With Quote
View Public Profile
 
Old 09-14-2010, 03:54 PM Re: Resetting a Demo Automatically
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I'm always puzzled why so many think that a demo has to reset at a given time, and then play about with cron jobs or schedules.

Just check if it needs to reset when a user starts the application and reset it then.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-17-2010, 12:47 PM Re: Resetting a Demo Automatically
Banned

Posts: 8
Name: Robert Lefebvre
Trades: 0
hmmm, good point chrishirst,. Also, I might even have a database table to serve as a log to record how much usage it is getting so I can review how/where they go and how they use it.

Last edited by chrishirst; 09-17-2010 at 12:53 PM.. Reason: bold formatting removed
BungeeBones is offline
Reply With Quote
View Public Profile
 
Old 09-17-2010, 01:04 PM Re: Resetting a Demo Automatically
Ultra Talker

Posts: 366
Name: Steve
Location: Miami, FL, Earth
Trades: 0
Try using "TRUNCATE table_name" to remove all info from your DB (better than purging your DDL and rebuilding).
__________________
- Steve

President,
Please login or register to view this content. Registration is FREE
smoseley is offline
Reply With Quote
View Public Profile Visit smoseley's homepage!
 
Old 09-18-2010, 09:10 PM Re: Resetting a Demo Automatically
Novice Talker

Posts: 5
Name: Marcel Dijkgraaf
Location: Holland
Trades: 0
Try using the empty-table button manually
After all... it's just a demo. Wouldnt make that too advanced IMHO
Crons I use only for the hardcore hardcore production-process only. After testing everyting... manually.
oortm is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Resetting a Demo Automatically
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31106 seconds with 12 queries