Hi,
I have two mysql tables (Table1 and Table2) that have exactly the same structure.
How can I write the SELECT query to extract all data from the two tables ?
This works in PostgreSQL (and every rdbms I know), try it in MySql:
SELECT FROM Table1 UNION SELECT FROM Table2;
That will only work in MySQL > 4.0 In ond MySQL you'll have to use two queries and merge in PHP, or create a temp table in MySQL and insert everything in there, and then select from the temp table.
Hi Vincent,
Can you give a sample php code of the 2 queries you suggest ?
Thx
Whatever query works to get the proper data from each table, then read the results from each query into an array, and merge the arrays in php.