Update MySql after time
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.
Unknown system variable
Hello, when I try to enable event_scheduler I get an error:
Unknown system variable 'event_scheduler'
And I used mysql_query("SET GLOBAL event_scheduler = ON")
Any ideas on how could I fix that?
What version of MySQL are you using? Just done a bit of digging and it seems that the event scheduler is only available in MySQL 5.1.6 and later.
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?
Ohh yes, you are right. I am running older version so I will not be able to use it as for now. Thanks for help.
Help with app
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.
Hey, thanks for the reply
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.
I'm pretty certain that PHPMailer is capable of saying whether it successfully sent an email or not -otherwise how would you know?
Originally Posted by phpbuild12
See this example in the documentation:
Ok, may I just ask what is wrong with this code:
$select_that_user = mysql_query("SELECT Number, Surname, Name, Email, Birth FROM people WHERE Number = $id_click") or die(mysql_error());
It doesnt works, but when I use it without WHERE Number = $id_click" it works :S
What does it do instead?
What is $id_click? What is it really, not just what you think it's supposed to be?
Does mysql_error() say anything? What?
Try and give us a bit of information when you ask questions.
Last edited by Weedpacket; 11-22-2012 at 07:40 PM.
Hey, will post about that later.
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.
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).
Originally Posted by phpbuild12
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)