trouble with create even
Date: December 21, 2011 05:23AM
I have written these codes in mysql, all the codes execute with out any problem but when I add "CREATE EVENT madi ON SCHEDULE EVERY 1 DAY DO " this query executes wrongly and DELETE codes run sooner than INSERT code, and also the event doesnt work regulary. please help me with this problem.
INSERT INTO thanksmsg1( thanksid1, userid, sendername, recivername,reciveremail,
text, attach, score, cost, sendyear, sendmonth, sendday, subject,
tempid, draftid )
SELECT thanksid2, userid, sendername, recivername, reciveremail,
text, attach, score, cost, sendyear, sendmonth, sendday, subject,
tempid, draftid
FROM thanksmsg2
WHERE sendyear=YEAR(CURDATE())
AND sendmonth=MONTH(CURDATE())
AND sendday=DAY(CURDATE())
AND userid IS NOT NULL;
DELETE FROM thanksmsg2
WHERE sendyear=YEAR(CURDATE())
AND sendmonth=MONTH(CURDATE())
AND sendday=DAY(CURDATE());