I've got two databases, same schema structure, basically company A and company B. I can get the data I want from each individually but need to combine the results of identical queries then echo it out on the page, i.e an employee directory that list employees from both companies but all in one page.
I have the following code from company A:
$A_query = "SELECT employee_name
FROM
UPEMPL";
$A_result = odbc_exec($connect_companyA, $A_query);
$A_rows = odbc_fetch_row($A_result);
I have the following code from company B:
$B_query = "SELECT employee_name
FROM
UPEMPL";
$B_result = odbc_exec($connect_companyB, $B_query);
$B_rows = odbc_fetch_row($B_result);
How can I get the results of both into a single result to work with? Another twist with this is that it could be possible that an employee could be in both companies so I would only want to see that employee one time in the final result.
Any suggestions or direction would be great.
I have the following code from company A:
$A_query = "SELECT employee_name
FROM
UPEMPL";
$A_result = odbc_exec($connect_companyA, $A_query);
$A_rows = odbc_fetch_row($A_result);
I have the following code from company B:
$B_query = "SELECT employee_name
FROM
UPEMPL";
$B_result = odbc_exec($connect_companyB, $B_query);
$B_rows = odbc_fetch_row($B_result);
How can I get the results of both into a single result to work with? Another twist with this is that it could be possible that an employee could be in both companies so I would only want to see that employee one time in the final result.
Any suggestions or direction would be great.