Link to home
Start Free TrialLog in
Avatar of bergstrom_davin
bergstrom_davin

asked on

Switching Between Database Servers using PHP

PHP and MSSQL
I developed a class that works exactly how I would like it to. The limitation is switching cross db servers. I asked a similar question earlier this week for switching databases, after a few replies I found the USE condition, and it worked.

Any ideas how I can maintain two database connections to different servers?

Please don't just send me to the API. I more of a designer than a developer, so simple OOP methods would be preferred.

Thanks in advance guys (and gals).
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bergstrom_davin
bergstrom_davin

ASKER

For most of the time I need use DBa, sometimes I need to use DBa and DBb.

I am not sure how this will switch the link identifier. Where to I get the resource from?

But once I have the $db_resource I can pass it to the query and MSSQL will switch.
mysql_query($sql, $db_resource);

Thanks hernst42
I ended up just reconnecting.