i am currently working on anppication where i need to increment a counter depending on date. i mean i want to send 3 sms per day. How can in implement this feature.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need a database (or some other permanent way) to store the count, with columns like “account id”, “date” and “count”.
When the user wants to send an sms, get his record by his account id (whatever that is). Check the date from that record against the current date. When you get no record, that user never sent an sms. When the date is not the current date, the user didn’t send anything today.
Else check the count.
After sending, update (or insert) the record with the new count and date.