$queryActivities = mysql_query("
SELECT ua.status, ua.date, 'status' AS is_table FROM users_statuslog ua
WHERE ua.uid = '{$showU[id]}'
UNION ALL
SELECT us.message, us.date 'wall' FROM users_wall us
WHERE us.uid = '{$showU[id]}'
ORDER BY `date` DESC");
This is what I have right now. And I need some more columns from users_wall, more than I need in users_statuslog. How can I select them? Because I can not do like this:
(Lets say I also want isReplyFrom and viewed from the users_wall)
$queryActivities = mysql_query("
SELECT ua.status, ua.date, 'status' AS is_table FROM users_statuslog ua
WHERE ua.uid = '{$showU[id]}'
UNION ALL
SELECT us.message, us.date, us.isReplyFrom, us.viewed 'wall' FROM users_wall us
WHERE us.uid = '{$showU[id]}'
ORDER BY `date` DESC");
I’m getting:
The used SELECT statements have a different number of columns.