Got a query like this:
SELECT * FROM job WHERE status!=2 AND status!=3
UNION SELECT * FROM emp WHERE status!=2 AND status!=3
ORDER BY (id/popularity) DESC LIMIT {$from},$vpc
It works perfectly, but now can’t identify where from record is coming…
Is there any way to identify from which table, the record is coming?
I guess you could try this:
This should add a field named origin to your results, containing a name of your choice to identify the table.