Hi guys,
I want to implement this logic in my application 'payment based on usage once in every month'.First let me explain my application running PHP & MySQL.
User will access my application for creating ads(image,flash,movie).There is no limit for ad creation.At end of each month we will bill them based on total no of ads created by that user.
I am planned to implement like this:
I will set a crontab that will run once in 15th of each month and calculate the total ads and recorded in DB.I will bill them on 30 th of that month using the details from DB.
Drawback(issue's) :
1) If user is creating ads after 15th.We can't able to bill them at the current month
2) If user is creating an ad on 2nd and he deleted that ad on 14.we can't able to bill that ad also
3) I thought we can set one autoincrement field in the DB.That will be incremented by 1 once user creates an ad.(This logic is not so efficient).
I Like to implement this logic in efficient manner.Any one can give some idea's or suggesstions.
I am looking for some help from you guys.
A.suresh