Platform: FreeBSD amd64
Script: PHP
DB: MySQL
I need someone to write one or two garbage collectors, preferably in PHP, that will simply query a table in mysql for records older then say 30 days from NOW() based on the createtime column, which is datetime.
This script will be ran via crontab, not via http, so no html or anything is needed.
---------------------------------------------------------------
For the next script 'the updater'.
This script will also run via crontab only, which I would also like written in PHP. This script will be a little more complicated, you may need to use JOIN, but I'll leave that up to you.
I have two tables
* products
* product_pricing
I need this script run a few queries 'products' for products older then 120 days from NOW(). The date column type on this table is date '0000-00-00'
So we would run a query like
- select id AS product_id from products WHERE sid = 291821 and releasedate <= 120 days old
Then
If the product is within the 120 days, it does an update on the record
e.g. UPDATE product_pricing SET mode_7 = 19.95, mode_30 = 21.95, mode_d_7 = 20.95, mode_d_30 = 22.95, mode_d_own = 35.95 WHERE product_id = XXXXXXX
If this product is older then 120 days.. it should do a seperate update:
UPDATE product_pricing SET mode_7 = 14.95, mode_30 = 16.95, mode_d_7 = 14.95, mode_d_30 = 16.95, mode_d_own = 25.95 WHERE product_id = XXXXXXX
Should be pretty straight forward.. hour maybe two hours of work max.