Hey, Id like to ask how could I automatically update a database after certain ammount of time passed?
I have listed people with birthdays, and when I send them an email it adds email sent text beside their name. I do that by changing a value in database. Now I need to make it so that value goes back to 0 after like half a year so that for their next birthday I am able to do the same.
Why don't you do it the same way that you're doing to add the text beside their name? Also, I'm assuming from your post that you're actually adding text to their name field in the DB? Why not use a separate field for this?
Hello, I need to create a birthday app for my website.
What do I have so far:
- Display people who have birthday in 1 week.
- Click on them, type in email, send email.
What I need:
- Somehow add 'Email already sent' after sending an email to THAT person next to their name.
- Make it so that I am unable to click on that user and send email again.
- Make it so that after some time (like 11 months or so) I am able to send him another email ( new birthday ).
I did it with start event function, but in this case I cant use it. I really need help on this one, thanks for all answers in advance.
- The mail() function returns true if successful (note this doesn't mean the recipient will get the email, just that the function ran successfully), so display the message
- If the mail() function is successful, add a value to the database that if set to true or if their birthday isn't in one week or whatever you cannot send another message
- See above.
I am not using mail() function, I have PHPMailer, sorry for not mentioning.
Right now everything works and all, email arrives, but I need somehow to change it to Mail sent and after some time back to normal so its ready for next year.
Right now I have another question. I now save a date when an email has been sent into database, and write Email already sent beside their name. I need to make it now so that after few months or so I am able to click on them again and send another email for new birthday.
Last edited by phpbuild12; 11-23-2012 at 02:23 AM.
Right now I have another question. I now save a date when an email has been sent into database, and write Email already sent beside their name. I need to make it now so that after few months or so I am able to click on them again and send another email for new birthday.
Honestly, your questions would be answered a lot quicker if you stuck to one at a time (and provided as many details as possible, including any relevant code).
I know but Im working on it and sometimes find solution, sometimes get into another problem. Right now it seems to work fine, I just have to make it as I posted before
Ok, now I made a little bit of a progress. Ive made it so when I send them an email for birthday, I created a new table and I insert ID of email sent (unique number, AI), date when it was sent, and to who.
Now I need to make it so that it checks each one when it was send, and if it was sent more then 1 week ago do something else do something else. I did it with if statement, but it only takes the date of the last one sent, not each as individualy.
Bookmarks