$raw_results = mysql_query("SELECT sno,name,email,phone,smpc FROM existing_sales_details
WHERE (`sno` LIKE '%".$query."%') OR(`name` LIKE '%".$query."%') OR (`email` LIKE '%".$query."%') OR (`phone` LIKE '%".$query."%') OR (`smpc` LIKE '%".$query."%')
UNION
SELECT sno,name,email,phone,smpc FROM sale_details
WHERE (`sno` LIKE '%".$query."%') OR(`name` LIKE '%".$query."%') OR (`email` LIKE '%".$query."%') OR (`phone` LIKE '%".$query."%') OR (`smpc` LIKE '%".$query."%')
UNION
SELECT sno,name,email,phone,smpc FROM uncharge
WHERE (`sno` LIKE '%".$query."%') OR(`name` LIKE '%".$query."%') OR (`email` LIKE '%".$query."%') OR (`phone` LIKE '%".$query."%') OR (`smpc` LIKE '%".$query."%')")
or die(mysql_error());
i have three tables and when i retrieve data from them i also want to get the table name to know this data belongs to to this table how can i retrieve the table names according to data please suggest me.