how events works in mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kushaljutta
Forum Commoner
Posts: 50
Joined: Fri Dec 26, 2008 11:05 am

how events works in mysql

Post by kushaljutta »

i need some information about events in mysql...

my need is i want to send email with php using mysql when the sql time reaches the specified time....is this possible in mysql..

please help me

thanks in advance

Kushal.J
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: how events works in mysql

Post by jackpf »

I've never seen something like this myself...although it may well be possible.

Sounds like you want to use a cron job/scheduled task though.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: how events works in mysql

Post by Eran »

MySQL can run timed events on itself, but cannot run outside processes such as PHP. Like Jack suggested, you should use a cron job for that.
http://dev.mysql.com/doc/refman/5.1/en/events.html
User avatar
batfastad
Forum Contributor
Posts: 433
Joined: Tue Mar 30, 2004 4:24 am
Location: London, UK

Re: how events works in mysql

Post by batfastad »

On our intranet we have an e-mail reminders system so users can add scheduled task which either pops up on the intranet screen (using jquery timed ajax) or e-mailed to them using a half-hourly cron job and swiftmailer.
It works well but its quite low traffic... 10 e-mail reminders per day on average

HTH
Post Reply