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:
Expand|Select|Wrap|Line Numbers
- $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?