Jump to content

Database Connections


metalwar

Recommended Posts

Hello,

I am designing a web site for a housing company. They have a database (I believe it's MS SQL) that contains information regarding vacancies of their units which I would like to pull and display on the site.

 

So my question is: is it possible to have the web site hosted by arbitrary company x, on their server, and connect to our server's database through php? Every example I have seen, it looks to me like the php scripts are being run on the same server as the database (or maybe I'm just missing something). If it is possible, could somebody point me in the direction of some sources and/or some sample code.

 

Any help would be much appreciated.

Thanks

Link to comment
Share on other sites

Yes PHP can connect to remove database servers. Just make sure the remote server allows connections from the internet.

 

When you want to connect to the remote ms sql database you'll provide the ip address or the url to the remote mssql server, eg:

$cnx = mssql_conncect('ip/url to database here', 'username', 'password);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.