How to execute a program continuously on a server? And which language to use?

Problem :

Okay this is my first post here so please forgive me if i mess something up.

I am trying to build a web program that will send email with content drawn from a db at a time specified in the db to a email address specified in the db. I am fluent in php & mysql and initially assumed i would base this program on those languages but i cant figure out how to use php to achieve my purpose. So i assume i will have to turn to another language, but i haven't the vaguest idea of which to turn to.

My other problem is that i don't know how to setup whatever script i end up making to run continuously.

Thanks for the suggestion Russ, to begin with it will be hosted locally either on my centos box or my xampp server, probably the later until it is working properly and i don't know about the future as it is just an idea right now.

EDIT: I actually did this in perl, it did end up a little different than originally planned but it worked so im happy.

Thanks to all who answered.

Solution :

If you are concerning only on how to schedule the send email function, you can try some open source scheduler like

Mysql Tutorials

Mysql Howto..

how can I make new users password more secure?

How to determine field-type for SOLR indexing?

How to fill a single MySQL table with certain columns from multiple CSV files?

how to subtract AS value from AS value in a extra AS column in MySQL

Show distinct selection in webform?

how to account for a newline in a mysql text field?

How to use jQuery SlickGrid with PHP / MySQL (load server data and save changes)

php PDO and mysql: how to insert a geo point type?

How to save a hash of a password in MySQL

How to store arabic text in mysql database using python?

Building a MTurk-like app — how to use a db when column names change for each task?

how to generate Data Base DB script in MySQL (MySQL Query Browser / Toad for MySQL)

How do you Change Array Index Keys to MySQL values

How to delete multiple checkboxes when selected in php and mysql?

How to put mysql inside a php function?

How to set default value in SubQuery result using mysql

How to set up MySQL query?

How to create pseudo document oriented model?

ODBC How to store a variable length array of strings?

How to merge 2 rows in mysql

How to generate MD5 encrypted password in MySQL?

How to execute SELECT and INSERT in single query with PHP/MYSQL?

MySQL join query - how to approach 3 tables?

Select multiple files shown on JTable and download them from the MySQL database

How can I convert a column of date strings in a mysql db to UNIX timestamps?

How to generate invoice number with special requirement using PHP or MySql

How to change mysql Delimiter inside Kohana framework during call one model method?

How to check if record deleted was last record left MySQL PHP

Mysql how to use COUNT value of rows from joined table in WHERE statement?

How to import a mySQL database without creating a new one