I’m searching in two tables for a string.
$sql="SELECT download.title FROM download
WHERE download.title LIKE '%$search%'
UNION
SELECT news.title FROM news
WHERE news.title LIKE '%$search%' OR news.text LIKE '%$search%' ";
How can I find out what table the records I have found are from?
Why not just add a discriminator column in your result-set? That enables you to query once, and get the results by source.