halo there, i need some help on writing store procedure. i have 1 table which store the productid,productname,customerid expirydate of the product, remindersent. customer table---> cusotmerid, customeremail wat i wan to do is, i wan to check the expiry date for each customer 's products . if the date diff between expirydate and today is 30days, then send a reminder to the customer and update the remindersent to 1. if the date diff expirydate and today is 14days, then send a reminder to the customer and update the remindersent to 2... how i write tis in store procedure? plz guide me on how to write it. i know the basic for the store procedure, select, update, insert and delete only.thank you.hope can hear frm u all as soon.....coz urgent..plz help.
you will need to run a cron on server and setting up a cron is easy from cpanel of webserver. Before you setup a cron make a php file which checks the expired products and delete them Set that php program as cron Regards Alex
It depends what db you are using. If you have SQL Server (not express) then you can use SQLAgent to schedule to job to run. Dont know if MySQL has an equiv but as above, if your using Apache then a cron job is an easy one. If your using IIS and SQL Server Express then your options are very limited as neither have built in options for reliably timed jobs and it is generally easiest to write a hidden page to do the necessary and then write a small app to sit on your own PC that simply calls that page at the alloted time.