• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

PHP: connecting to remote MySQL server

Agum

New Member
Hi,
Basically the site I'm writing this banner rotator script for is on a host that doesn't support MySQL. (don't ask, long story. I know most hosts support it and all now, but it's just impossible to move at this point. sorry long story.) However I'd like to use MySQL to store info like how many times a banner is displayed because I figure, if I use a text file database for this, the text file would need to get accessed every time a banner is loaded (which is when any static HTML page is loaded), and since the site gets thousands of unique visitors a day, that's quite a lot.

However, the owner of this site (not me, so out of my control again) actually owns another domain, hosted on another web host that actually supports MySQL. I am actually thinking about having the banner rotator script connect to the MySQL database on this server instead -- but then the script would have to establish a remote connection every time a static HTML page is loaded. I was wondering if this would add a lot of overhead or server load on both sides.

Or actually, would a better idea to be simply put the entire banner rotator script on the second server and have the first server a href img src link directly to the script on that server? Coming to think about it that would actually be a pretty good idea... the script can then just connect to a localhost database.
 
It wouldn't be as fast and the MySQL Host would need to allow external access (vs. only "localhost") to their MySQL Server, which many don't.
 
Back
Top