On 12/3/03 7:27 PM [EMAIL PROTECTED] wrote:

Hi,

yah that's what I'm looking for, creating a "cronjob" whereby this "cron" will automatically delete the record once 30 days is up...maybe using something like that:

"DELETE FROM tablename
 WHERE (DATA_SUB(NOW()), INTERVAL 30 DAY) > name_of_date_column; "

But now the point is, what if the student decided to cancel his withdrawal within these 30 days, (that was also the reason why to keep the record for 30 before deletion ) , how shld i go about updating the status of the student to "1" (active)again ???

How is the "0" getting in to the status field in the first place? If he cancels the withdrawal (through some web form you have?) Then update the table accordingly.


And, how to cancel the "cronjob" so that it will not delete the student record after 30 days???I hope I have made myself clear...

Add an AND clause to your DELETE statement that checks to see if the "status" field is "1" or "0".


--Jo


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to