MySql Check Replication Script – Script run from cron & test slaves, if slave down, reconfigure to use master.
PHP to MySql connection – PHP class that help connect to Master-Salve servers.