1
私のSQLの結果を以下のような3つのカラムに表示したいと思います。結果をカラムに表示
どうすれば可能ですか? trとtdのテーブルを追加する必要がありますか?私のコードでdiv?私は、タグを日食のか分からない
CategoryName1 CategoryName2 CategoryName3
subcategoryN subcategoryN subcategoryN
<?php
foreach ($resultLang as $oneRec)
{
$catid= $oneRec["categoryID"];
echo"<strong>".$oneRec["categoryName"]."</strong><br>";
$sqlCmd2 ="SELECT subcategories.subCatID,subcategories.subCatName
FROM subcategories
JOIN categories
ON subcategories.categoryID=categories.categoryID
JOIN languages
ON categories.languageID = languages.languageID
WHERE languages.languageID =:lang
AND categories.categoryID=:cboCat";
$prepQuery2 = $conn ->prepare($sqlCmd2);
$prepQuery2->bindParam(":lang",$langTemp, PDO::PARAM_INT);
$prepQuery2->bindParam(":cboCat",$catid, PDO::PARAM_INT);
$prepQuery2->execute();
$resultLang2= $prepQuery2->fetchAll();
foreach ($resultLang2 as $oneRec)
{
$subCatid=$oneRec["subCatID"];
echo "<a href='displaysubcategory.php?subcat=?$subCatid'>".$oneRec["subCatName"]."</a></br>";
}
echo "<br>";
}
質問を正しく書式設定してください。 –