I have an accommodation availability and tariff page that is populated from a MYSQL table and would like to incorporate Automatic Pruning by date expiry from the table. What is the best way to accomplish this using PHP and MYSQL and my just about intermediate coding skills.
Thanks in advance for any help and guidance.
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
International SEM | Social Media | Search Friendly Design | SEO | Paid Search / PPC | Seminars | Forum Threads | Q&A | Copywriting | Keyword Research | Web Analytics / Conversions | Blogging | Dynamic Sites | Linking | SEO Services | Site Architecture | Search Engine Spam | Wrap-ups | Business Issues | HRA Questions | Online Courses
Automatic Date Related Pruning
Started by
piskie
, May 23 2008 08:16 PM
6 replies to this topic
#1
Posted 23 May 2008 - 08:16 PM
#2
Posted 24 May 2008 - 05:54 AM
DELETE FROM table WHERE datecolumn BETWEEN date1 AND date2 ;
or set/reset a flag to deactivate the entries.
or set/reset a flag to deactivate the entries.
#3
Posted 24 May 2008 - 06:57 PM
Chris, I would like to delete a date entry when the actual date passes the entered date.
Example: the entry for week begining Saturday 7th June should be automatically deleted when the actual date reaches the 8th June.
Example: the entry for week begining Saturday 7th June should be automatically deleted when the actual date reaches the 8th June.
#4
Posted 24 May 2008 - 09:19 PM
Delete the whole database table entry or just the date field?
Either way you could do it with a simple MySQL delete statement as Chris laid out above, then set up a little cron job on a script to parse through the database table to figure out what needs to be deleted and what doesn't. Set up the server to fire it at 1am or something and you'd always be good to go without any daily hands on action.
Either way you could do it with a simple MySQL delete statement as Chris laid out above, then set up a little cron job on a script to parse through the database table to figure out what needs to be deleted and what doesn't. Set up the server to fire it at 1am or something and you'd always be good to go without any daily hands on action.
#5
Posted 25 May 2008 - 05:31 AM
Thanks Randy and Chris, I will set about doing that in the next few days.
#6
Posted 25 May 2008 - 06:53 AM
One small heads up...
Figure out how the date is being set originally before you even dig into the coding aspect. There are different formats (eg php date is not necessarily the same as using a MySQL date function) and knowing what is used to set the date initially will save you a lot of heartburn.
Figure out how the date is being set originally before you even dig into the coding aspect. There are different formats (eg php date is not necessarily the same as using a MySQL date function) and knowing what is used to set the date initially will save you a lot of heartburn.
#7
Posted 25 May 2008 - 10:12 AM
Thanks Randy, I am already on to that as I am trying to convert a Day+Month+Year set of dropdown inputs (Client Interface) into "Unixtime" which I already use to store a "lastupdated" field.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users








