I'm looking for a way to sort the results of 3 seperate queries of different tables by a timestamp field that's on each table.
$sql1 = "SELECT * FROM chores WHERE Status = 'unchecked' ORDER BY Time DESC";
$sql2 = "SELECT * FROM contacts WHERE Status = 'unchecked' ORDER BY DateTime DESC";
$sql3 = "SELECT * FROM gyms WHERE Status = 'unchecked' WHERE Endtime IS NOT
NULL ORDER BY EndTime DESC";
So say I have those 3 queries, and I want the data from the row whose timestamp field is the 3rd oldest, compared to all of the other rows in all of the other tables. Is there an easy way to do this either in a SQL Query or in PHP? I'm struggling with figuring out the logic for it.