external MySQL connection (DW)
Posted by: aheinz! (81.169.237.---)
Date: November 13, 2007 07:17PM

Hi everybody,

I don't know if I've come to the right place for this one, I've checked the forum but didn't find exactly what I'm looking for ..
I'm building a website (with dreamweaver) that has to connect to a remote MySQL database. The point is, that there are 2 domains and 2 websites, so:
www.domain1.com, and
www.domain1.es
where domain1.com is hosted on server1,
and domain1.es on server2
The MySQL database resides on server1 under domain1.com, in website1.
(I hope you're still following...)
Now I need website2, with domain name www.domain1.es on server2, to connect "into" server1 and onto the (one and only) database from the organization.
Just to clarify, we are talking about one (1) organization, that hosted 2 domain names, one .com and the other .es for the same organization. The 2 different websites will be maintained by 2 different people of the organization, but they need to work with the one, unique database from the organization.

And now my questions:
- How do I connect to this database: does website2 needs to reside on the same server as website1?
- Can a website be hosted by one provider and it's domain name registrated by another? (i.e. let's say that website2 is put on the same server as website1, together with the database, but the domain name "www.domain1.es" is registrated with another provider)...
- does my testing server configuration needs to be localhost or the remote server?

thanks in advance for any help, suggestions, compassion ;-)



bye,

Options: ReplyQuote
Re: external MySQL connection (DW)
Posted by: jw_k (---.net-you.de)
Date: November 13, 2007 09:10PM

assuming that you intend to use php/mysql ...

<?php
//header stuff

$dbs = 'domain1.com';//or ip-address
$dbu = 'remoteUSR'; //must be granted access from domain1.es !
$dbp = 'rUSRpw';
$hdl=MYSQL_CONNECT($dbs,$dbu,$dbp) //or mysqli ...
or die('#'.mysql_errno()." <B>$dbs</b> ".mysql_error());

//do the queries & show results
//....
?>
this script can run anywhere winking smiley

Options: ReplyQuote
Re: external MySQL connection (DW)
Posted by: aheinz! (81.169.237.---)
Date: November 13, 2007 09:38PM

hi,
Thanks for your quick reply!
I'll try this and let you know the results..
thanks in advance

p.s. yes, I'm using php/mysql



bye,

Options: ReplyQuote


Sorry, only registered users may post in this forum.