I have two tables that have logging information for different actions. I want to select information from both logging tables and display it. I cannot modify the application, so I can't modify the table structure. Assuming I wanted, say, 30 records, I figured I could write some kind of join query that would just return the IDs for each table, in order by time. Then I could simply run two separate queries selecting those IDs from the individual tables. I'm not sure how to do this, or if you even can do this, and I'm kind of at a loss. Can anyone help? If there's a cleaner solution I'd be happy to hear that as well, I'm working in PHP.

Example data:

MAGICAL SELECT ? FROM table1 MAGIC JOIN table2 MAGICALLY ORDER BY date DESC LIMIT 3

Table 1

```
|------|-------|------------|
| id   | date  | other data |
|------|-------|------------|
| 1    | 8     | ...        |
| 2    | 5     | ...        |
| 3    | 3     | ...        |
|------|-------|------------|

```

Table 2

```
|------|-------|------------|
| id   | date  | other data |
|------|-------|------------|
| 1    | 6     | ...        |
| 2    | 4     | ...        |
| 3    | 12    | ...        |
|------|-------|------------|

```

Output

```
|-----------|-----------|
| table1_id | table2_id |
|-----------|-----------|
| NULL      | 3         |
| 1         | NULL      |
| NULL      | 1         |
|-----------|-----------|

```

Thanks in advance.