Hey so I have been doing a lot of research and haven't found too much.
I am working on a project where I need to select calendar events from 2 different calenders (on 2 different servers) and display the combined events on 1 calendar. In order to do this I am going to create a script that grabs the data from the database on server a and insert it into the database on server b.
In order to do this I need to make 2 different mysql connections. Just to clearify, I understand how to connect to a database and display data from a table.
For my database i just did a normal connect:
I figured to connect to the database on the other server i'll have to create a mysql connect as well. I wasn't sure what I need to put under hostname? I know localhost won't work because it is a different server. I tried using the domain name theotherwebsite .com and the IP address, and neither worked?
Is that the correct way of doing it? Or do I need to configure both servers to allow connections from non-local servers? And depending on the server (i.e. linux, mac, etc..) will the server be configured in a different manner?
I am working on a project where I need to select calendar events from 2 different calenders (on 2 different servers) and display the combined events on 1 calendar. In order to do this I am going to create a script that grabs the data from the database on server a and insert it into the database on server b.
In order to do this I need to make 2 different mysql connections. Just to clearify, I understand how to connect to a database and display data from a table.
For my database i just did a normal connect:
Code:
$hostname_mywebsite = "localhost"; $database_mywebsite = "my_database"; $username_mywebsite = "my_username"; $password_mywebsite = "my_password"; $mywebsite = mysql_pconnect($hostname_mywebsite, $username_mywebsite, $password_mywebsite) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_mywebsite, $mywebsite); etc....
Is that the correct way of doing it? Or do I need to configure both servers to allow connections from non-local servers? And depending on the server (i.e. linux, mac, etc..) will the server be configured in a different manner?
Comment