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
Automatically Deleting Database Entries
Old 05-12-2009, 08:46 PM Automatically Deleting Database Entries
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
Hey guys,

I was wondering whether or not MySql could automatically empty all the data from a table after say, 3 hours. Even though the user isn't looking at the website.

eg. Bob uses the site, inputs some temporary data (that isnt ment to be stored forever) then closes the browser and goes to bed.
He wakes up in the morning and goes back to the site, and his data is gone.

Would you just put a check at the top of the php page to see what the time is now, check it against what time the data was inputted into the database, and then just empty it? Or can it be done all automatically?
__________________
Websites Created;
warscope.com
ratepayers.org.nz
lothop is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-12-2009, 10:09 PM Re: Automatically Deleting Database Entries
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
You can store data in sessions variables and then set those to expire after a certain amount of time?
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 05-12-2009, 11:22 PM Re: Automatically Deleting Database Entries
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
There will be a lot of data that needs to be stored. Is there a limited amount that can be stored in sessions?
Also the database would allow multiple entries into the database by the same person.
So if someone makes a monster called "grosh", gives him 5 arms, 2 mouths and 3 legs.
They can then make another monster and temporarily store both of them. Then can make them fight each other, which ever wins they can store permanently. Or they can make the temporary ones to fight the permanent ones. Then if one isnt very good, the user doesnt have to delete it. They can just leave it and it will be removed after some time.
__________________
Websites Created;
warscope.com
ratepayers.org.nz
lothop is offline
Reply With Quote
View Public Profile
 
Old 05-13-2009, 01:40 AM Re: Automatically Deleting Database Entries
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
I was wondering whether or not MySql could automatically empty all the data from a table after say, 3 hours.
No.
You have to setup a recurring job (know as cron jobs in the unix world) that will take care of it.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 05-14-2009, 08:14 AM Re: Automatically Deleting Database Entries
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
Cool, thankyou.

I think I've found a way around it that works for the best.
It will ask if they want to continue with an existing monster. If they dont, it deletes all the data.

Gives people an option to start fresh, or one they already made.
__________________
Websites Created;
warscope.com
ratepayers.org.nz
lothop is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Automatically Deleting Database Entries
 

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.56118 seconds with 12 queries