Page 1 of 1

Insert Data into 2 different databases (MySQL)

Posted: Mon May 14, 2007 11:30 am
by Maluendaster
Hi all, i was wondering if you can help me out on this.. I run a site and the users can register to our mailing list, but for example, if i have a site in http://www.site1.com (with a mysql database), and another site in http://www.site2.com (also with a mysql), and the form is in site1.com, and I want to insert the data of the users in the databases from site1.com and site2.com, how do i do that?? thank you very much for any help..

Posted: Mon May 14, 2007 12:20 pm
by volka
The connect method of your database extension probably has a parameter called server. Just pass the name or ip of the server you want to connect to. The server might be configured not to allow this but it's worth a try.

Posted: Wed May 16, 2007 10:14 am
by Maluendaster
volka wrote:The connect method of your database extension probably has a parameter called server. Just pass the name or ip of the server you want to connect to. The server might be configured not to allow this but it's worth a try.
thanks, but can you be a little more specific please? ..

Posted: Wed May 16, 2007 10:49 am
by volka
instead of mysql('localhost'... try mysql_connect('name_or_ip_of_the_other_server'...

Posted: Wed May 16, 2007 1:54 pm
by Maluendaster
volka wrote:instead of mysql('localhost'... try mysql_connect('name_or_ip_of_the_other_server'...
thanks, ill try that.