I have 3 tables; I need to retrieve data from to a "Latest activity" feed. I have tried to fetch the data as following:
$sql = "
SELECT comments.comment_id, comments.comment_time,
support.ticket_id, support.ticket_date,
images.image_id, images.image_time
FROM
comments,
support,
images
WHERE
comments.comment_time >= 1408557172
OR
support.ticket_date >= 1408557172
OR
images.image_time >= 1408557172
";
Where time is the start of this day, but when I loop through the array I get a lot of duplicates. I know I am doing something wrong but I don't know how to fix it.