У вас есть дополнительный ,
, отсутствует закрывающий )
и псевдоним производной таблицы:
<?php include "config.php"; ?>
<?php $results = mysql_query(
"SELECT sum(hit) as total
FROM (
SELECT sum(hit) hit from sound
UNION ALL SELECT sum(hit) hit from soundK
UNION ALL SELECT sum(hit) hit from soundD
) rs") ;
while ( $row = mysql_fetch_array($results) ) { ?>
<?php echo $row['total'];?>
<?php }?>
Если вы хотите 3 отдельных столбца:
<?php include "config.php"; ?>
<?php $results = mysql_query(
"SELECT soundHits, soundKHits, soundDHits
FROM (
SELECT sum(hit) soundHits from sound
) a, (
SELECT sum(hit) soundKHits from soundK
) b, (
SELECT sum(hit) soundDHits from soundD
) c") ;
while ( $row = mysql_fetch_array($results) ) { ?>
soundHits: <?php echo $row['soundHits'] ;?>
soundKHits: <?php echo $row['soundKHits'] ;?>
soundDHits: <?php echo $row['soundDHits'] ;?>
<?php }?>