Buat bidang baru yang menunjukkan tabel sumber di SQL Anda:
$sql="SELECT salehotel.*, 'salehotel' as source
FROM salehotel
UNION ALL
SELECT saleland.*, 'saleland' as source
FROM saleland
UNION ALL
SELECT salehouse.*, 'salehouse' as source
FROM salehouse
ORDER BY RAND()
LIMIT 6
";
PHP Anda kemudian dapat menampilkan kolom ini sebagai:
<?php echo $row['source']; ?>