Jump to content

Archived

This topic is now archived and is closed to further replies.

realjumper

connect to mysql question

Recommended Posts

Hi,
Apologies if this isn't the right forum, but I hope someone could help me with this issue. We have 2 serrvers here.....one is the web server and the other is the Intranet server. The staff database is kept on the Intranet server and the web stuff is kept on the web server.

The Intranet is only avaliable on campus.

Now I have a need to develop.....(actually I already did the developing).....an application that queries both databases.....which are on different servers. The application is hosted on the webserver, with a connection to applicaton database as per the norm like this is fine:

[code]
<?php

// Make a MySQL Connection
mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("file_admin") or die(mysql_error());

?>
[/code]

But I also need to query the Intanet server. I can't seem to connect to the Intranet server. I have tried using the ip like this, which I thought would work....but apparently not

[code]
<?php

// Make a MySQL Connection
mysql_connect("202.11.23.10", "username", "password") or die(mysql_error());
mysql_select_db("staff_db") or die(mysql_error());

?>
[/code]

Is it not possible to connect via ip?

Share this post


Link to post
Share on other sites

×

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.