Using php or MySQL how can you match the results with the table it was retrieved from?Code:(select ID, title from table1 order by ID asc limit 10) UNION (select ID, title from table2 order by ID asc limit 10)
Using php or MySQL how can you match the results with the table it was retrieved from?Code:(select ID, title from table1 order by ID asc limit 10) UNION (select ID, title from table2 order by ID asc limit 10)
Last edited by james438; 05-07-2010 at 03:33 AM.
To choose the lesser of two evils is still to choose evil. My personal site
solved the problem whereCode:(select ID, title,table1 AS col1from table1 order by ID asc limit 10) UNION (select ID, title,table2 AS col1from table2 order by ID asc limit 10)col1is just a dummy column name.
To choose the lesser of two evils is still to choose evil. My personal site
Bookmarks