SELECT column1, column2, column3, column4, column5 FROM table1 WHERE column2 = :value
UNION SELECT column1, column2, column3, column4, column5 FROM table2 WHERE column2 = :value
所以我有这个查询,这是我的PHP:
<?php
if(isset($this->info)){
foreach ($this->info as $infor){ ?>
<tr>
<td><?= $infor->column1 ?></td>
<td><?= $infor->method ?></td>
<td><?= $infor = ($infor->column3 == 1) ? 'Completed' : 'Incompleted'; ?></td>
<td><?= $infor->column4 ?></td>
<td>$<?= number_format($infor->amount, 2, '.', ''); ?></td>
</tr>
<?php } } ?>
现在你看到<td><?= $infor->method ?></td>
我想在这里展示如果是来自table1或table2,我该怎么做?