Select from 2 Databases
Posted: Wed Oct 18, 2006 8:24 am
Hello!
I have 2 databases located on the same server. I need to select data from both databases in one query because I want to be able to sort by fields in the first database or the second database. Here's the way it looks:
db1 has a user table with user_id, name
db2 has a customer table with customer_id, email_address
I need a select statement that will select user_id and name from db1 and email_address from db2 where user_id = customer_id and I need to be able to sort by either user_id, name or email_address (depending upon what's chosen in my PHP form).
Any help would be GREATLY appreciated!!!
I have 2 databases located on the same server. I need to select data from both databases in one query because I want to be able to sort by fields in the first database or the second database. Here's the way it looks:
db1 has a user table with user_id, name
db2 has a customer table with customer_id, email_address
I need a select statement that will select user_id and name from db1 and email_address from db2 where user_id = customer_id and I need to be able to sort by either user_id, name or email_address (depending upon what's chosen in my PHP form).
Any help would be GREATLY appreciated!!!