Hello,
I need to select information from two different databases and join them into one web page. I am unsure how to go about doing this. I am not a PHP programmer, any help would be appreciated.
Hello,
I need to select information from two different databases and join them into one web page. I am unsure how to go about doing this. I am not a PHP programmer, any help would be appreciated.
You probably need to read this:
http://www.w3schools.com/Sql/sql_join.asp
Would that apply with the tables being in two different databases?
Not absolutely sure...
If the 2 databases are located on the same server (same "username", "password" and "localhost")...
I think you should try something like this:
$query="SELECT
first_database_name . first_table_name . optional_column_name ,
second_database_name . second_table_name . optional_column_name
FROM
first_database_name . first_table_name . optional_column_name
INNER JOIN
second_database_name . second_table_name . optional_column_name
etc...
On the same server just do this:
SELECT dbname.tablename.columnname,db2name.table2name.column2name FROM
dbname.tablename, db2name.table2name;
(I think you get the idea)
As far as I know you can't select data across multiple servers.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.