I need a simple php/perl script for my cronjob, which will do this in my mySQL db:
There are 4 tables in my DB. Here is a sample:
—
Table Deposits:
Status (active or not active)
Amount
Username
Expiration Date
Table Users:
Username
Balance
Table History:
Amount
Username
Expired Date
Table Preferences:
Cronjob Lastrun
—
Before running the cronjob, it should check the last run time & date in Table Preferences / Cronjob Lastrun if 24 hours has passed after running the cronjob (it should only do the amount crediting in every 24 hours, even if the cronjob is set to 12 hours or any problem happens) If date is correct, then it should put current time & date into the field and continue running. If there is some problem with the run date, send warning email to admin and halt running.
It will run thru each record from table Deposits, and do this:
For each ACTIVE record, check expiration date:
- If its expired, then move the whole record to table history and delete from table deposits.
- If not yet expired, then for each active record in table Deposits multiply amount by 0.25 (amount*0.25) and add that amount into Table Users / Balance field.
After running, email admin that everything was successful, or if there are any problems include those in email if possible.
Script is this simple.
I’m paying $25 for it.
Escrow needed!
DB access will NOT be given, please create the script with the sample above, and I’ll integrate it into my database