|
Posted by elyob on 01/09/06 01:58
I posted this on a SQL newsgroup, but it seems absolutely dead.
What I'm trying to do is develop on multiple machines, sometimes connected
to the internet, sometimes not. I'd like to connect to a localhost if the
remote database is not available. What's the best way?
As a bit more info, I am using subversion for version control, develop under
XP and am on a Linux server. Hence the reason I am looking for a system
independent solution.
Here is a simple example/thought.
$link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password');
if (!$link) {
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
}
Thanks
[Back to original message]
|