473,480 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

connecting to remote database

tolkienarda
316 Contributor
hi all

i would like to connect to a database on a different domain. and i was wondering what i have to change on the regular database connection code to make it work.
example i need to print info stored on my company's server on several of our client's pages.

[PHP]
$host="localhost";
$db_user="username";
$db_password="password";
$database="databasename";
$var = mysql_pconnect($host, $db_user, $db_password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $cms);
[/PHP]

thanks for any input
Feb 21 '07 #1
4 2084
Motoma
3,237 Recognized Expert Specialist
You will need to change your host to a fully qualified domain name or IP address.
You will also need to make sure your database is accessible from the internet.
Feb 21 '07 #2
tolkienarda
316 Contributor
is having my database accessable a php setting i can change in php.ini or is it somthing on the mysql side.

and will the domain like is shown below work

[PHP]
$host="http://www.nextstep-designsolutions.com";
$db_user="username";
$db_password="password";
$database="databasename";
$var = mysql_pconnect($host, $db_user, $db_password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $cms);
[/PHP]

thanks for your help

eric
Feb 21 '07 #3
Motoma
3,237 Recognized Expert Specialist
is having my database accessable a php setting i can change in php.ini or is it somthing on the mysql side.

and will the domain like is shown below work

[PHP]
$host="http://www.nextstep-designsolutions.com";
$db_user="username";
$db_password="password";
$database="databasename";
$var = mysql_pconnect($host, $db_user, $db_password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $cms);
[/PHP]

thanks for your help

eric
Having it accessible to the outside means having firewall and port forwarding set up correctly.
The host is fine except for the http://
Feb 21 '07 #4
tolkienarda
316 Contributor
ok thanks

eric
Feb 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2187
by: Rob | last post by:
Hi, In the server explorer in Visual Studio.Net I'm able to design tables, create stored procedures, etc for the SQL 2000 database running locally on my computer. If I add a connection to a remove...
2
4952
by: Jozef | last post by:
I'm using Access XP. I'm trying to create a table, modify a table, create in index, and create a relationship in a remote database in code from the program database. I know how to create and...
10
1686
by: ej1008 | last post by:
HI all I am having a windows Control running on ASP.Net webform. From this windows control I am trying to connect to database to do some database operations. Now I am facing problem while...
0
1529
by: Bennett Haselton | last post by:
In Visual Studio .Net 2002 Server Explorer, if I add a new connection under "Data Connections", I can specify a remote server name and the username and password that I want to use, but then when...
1
1370
by: NagaKiran | last post by:
Hi I need a help. I have a VB code In that I want to connect to a remote database thru VB code. Can we connect a Access database which is located in a web server thru VB? If so how can we...
4
1884
by: JIM.H. | last post by:
Hello, My database stays in a remote site and I have access it through VPN. I would like connect my current Windows based Asp.Net application with this database. What are my options? Can I...
18
2677
by: Asif | last post by:
Hi all, I am working on portal which is using MS Access 2003 database. The problem that I am facing is that once I received data from vendors I have to upload whole Access Database file to...
3
2671
by: Pakna | last post by:
Hello, I have what may be a beginner's question regarding DB2. How does one access a remote table on a remote database via SQL? What is the command string, is there an equivalent of Oracle...
10
15914
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
3
1752
by: Nymus | last post by:
I would like to use an access database as a shared database on a remote website. I don't know if it is possible, but this is what i would like to do with this database: - Use it to run a database...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7059
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3011
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.