0
這裏是我的問題,我怎樣才能得到topic_id = 27
裏面的cat_id = 2
?在左加入顯示最後輸入
而且其他的 「新」 的話題像ID = 24
感謝所有,和對不起,我不認識和我的英語:-)
$cat = $bdd->prepare('SELECT * from categories LEFT JOIN topics on topic_cat = cat_id group by cat_id limit 5 ');
$cat_show_list = $cat->execute();
echo '<table border="1">
<tr>
<th>5 Dernières catégories</th>
<th>Dernier topic</th>
</tr>';
while ($cat_show_list = $cat->fetch(PDO::FETCH_ORI_FIRST)){
echo '<tr>';
echo '<td class="#">';
echo '<h4><a href="category.php?id='. $cat_show_list['cat_id'].'">'. $cat_show_list['cat_name'].'</a></h4>'.'';
echo '<a> '.$cat_show_list['cat_description'] . '</a>';
echo '</td>';
echo '<td>'. $cat_show_list['topic_subject'];
echo '</tr>';
}
$cat->closeCursor();
請將您的代碼作爲實際代碼發佈,請不要模糊不清。 –
是的,抱歉:) –