I want to count rows from table1 and rows from table2 and retrieve a sum from both tables.
i use this...
$query=mysql_query("SELECT COUNT(*) AS total FROM (SELECT COUNT(*) FROM message_believe WHERE message_believe.uid_fk ='$uid' UNION ALL SELECT COUNT(*) FROM review_believes WHERE review_believes.uid_fk ='$uid' )");
$data=mysql_fetch_array($query);
echo $data['total'];
what do i do wrong?