if($result = mysql_query(
"SELECT `condition` FROM `table1` WHERE `id` = '1')
UNION ALL
SELECT `condition` FROM `table2` WHERE `id` = '1')
UNION ALL
SELECT `condition` FROM `table3` WHERE `id` = '1')"
){
$num = mysql_num_rows($result);
for($i = 0; $i < $num; $i++){
$table = mysql_field_table($result, $i);
echo $table.' cond: '.mysql_result($result, $i, 'condition').', ';
}
}
Here I can get results of query(condition), but I do also want to get the tables' names, in order to know to which table the result belongs, I tried it: mysql_field_table($result, $i), but it does not return anything. So please help me to get name of table, thank you in advance.