I am planning to write my first PHP server side code. It includes a scheduler that will email a message to a user on a specific date. The front end of the application is fairly simple.
PHP produces an HTML page where you can select a date in the future to post the message to a an email address. The question is how would you create an event manager in PHP to handle this? What database would you use? MYSQL or PostgreSQL and why!?It makes no difference MySQL and PostgreSQL can both handle this fine, they are called databases for a reason.
MySQL is more common as a LAMP stack and you will probably find a lot more information on using PHP with MySQL so I'd stick with that.
To run schedule tasks on server use cron. With cron you can run php file that will read data from database and send email.
In regards with the scheduling, you can utilize a cron job if you are using Linux. Windows has a similar service as well.
精彩评论