Results 1 to 8 of 8
Dec 16, 2011, 22:50 #1
- Join Date
- Oct 2004
- Newport Beach
- 0 Post(s)
- 0 Thread(s)
Connect to Different Database Depending on MySQL Syntax
On a typical page I will have a number of queries that all refer to the same mysql resource...
Both an Update and a Select at least. I'm going to use two remote MySQL servers now, one for everything other than Select (a master DB to write to), and the other for Select queries only.
Here is my typicaly mysql_connect script resource referred to by all my MySQL queries:
$dbh=mysql_connect ("server1_address", "user", "password") or
die ('I cannot connect to the database because: ' . mysql_error());
At all possible? I have about 100 static pages that run my site, and each has up to 10 mysql queries. I'm trying to avoid having to change every query that is not using SELECT syntax to use secondary db connection resource.
Any feedback appreciated.