I’m doing a select using UNION ALL for a search page, so I need to know from which table the result come from, for me do a link to the correct page.
It’s possible?
Ex:
(SELECT id, title AS tit FROM video WHERE `title` LIKE '%test%')
UNION ALL
(SELECT id, title AS tit FROM testimonials WHERE `title` LIKE '%test%' AND _type = 'news')
UNION ALL
(SELECT id, title AS tit FROM image_gallery WHERE `title` LIKE '%test%' AND id_gallery = '1')
Cheers Mango
How about adding the table name to the SELECT statements?