类别,同时只显示一次类别标题。我有一个包含类别标题(父)的表和包含子类别信息的第二个表。虽然在显示信息时,我不知道如何只显示一次类别信息。
$result_array = mysqli_query($connect, "SELECT *
FROM tbl_customer, categories
WHERE tbl_customer.category_QA = categories.id
ORDER BY Category ASC");
while ($data = mysqli_fetch_array($result_array)) {
echo $data["Category"]; //display once for every new category
echo $data["productName"];
}