請幫忙!!我只是想顯示其talojongon沒有其他重複值的馬蘭 比方說,我的電流輸出爲:消除重複的特定行?
| Barangay | Disease |
__________________________________
| Talojongon | Cancer |
| Talojongon | Cancer |
| Talojongon | Cancer |
,我希望把這個給:
| Barangay | Disease |
__________________________________
| Talojongon | Cancer |
| | Cancer |
| | Cancer |
數據庫接收是數據庫中的疾病狀態馬蘭...謝謝...任何建議表示讚賞.. :)
這是我目前我的代碼部分
<br>
<table id="keywords" class="table table-striped table-bordered">
<thead>
<tr>
<th><center>Barangay</th></center>
<th><center>Diseases</th></center>
</tr>
</thead>
<tbody>
<?php
include 'database.php';
$pdo = Database::connect();
$sql = 'SELECT * FROM patients WHERE receive="Cancer"';
foreach ($pdo->query($sql) as $row){
echo '<tr>';
echo '<td><center>'. $row['status'] . '</center></td>';
echo '<td><center>'. $row['receive'] . '</center></td>';
}
Database::disconnect();
?>
</tr>
</tbody>
................ –
'GROUP BY Barangay' *很簡單*。 –