News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Evolt.org:
Failover Database Connection with PHP + mySQL
May 21, 2007 @ 12:04:00

Evolt.org has a recently posted tutorial that talks about creating a simple failover database connection for your PHP and MySQL application.

Imagine, you're connecting to a mySQL database with PHP, but hell, you want a bit more robustness. So why would you want just one database? You'd use a failover right? So if the first database is down or just doesn't connect, it can connect to the next one. Here's how to do that (I'm assuming you're already replicating between databases so that they're roughly in sync). Here's how you do it.

The tutorial walks you through the creation of a simple MySQL connection, but with two sets of credentials. The script tests the connection to the first database and, if it doesn't get a valid resource back, it falls back on the secondary. Of course, keeping the data in sync is your job.

0 comments voice your opinion now!
failover database connection mysql support tutorial failover database connection mysql support tutorial


blog comments powered by Disqus

Similar Posts

php|architect: Are We Losing LAMP?

PaperMashup.com: Easy PHP Pagination

OneNextraPixel.com: 13 Useful WordPress SQL Queries You Wish You Knew Earlier

TutToaster.com: How To Use, Style and Implement Wordpress Shortcodes

Tecmint.com: Install Apache, MySQL 5.5.27 & PHP 5.4.7 on RHEL/CentOS 6.3/5.6 & Fedora 17-12


Community Events





Don't see your event here?
Let us know!


unittest introduction wordpress application developer interview podcast series release configure list laravel community api code threedevsandamaybe library language framework install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework