aim: display the dish category title and then the dishes under/ foreach category title
this is what I’ve done so far well at least a snippet:
[code]
–> foreach ($assocarrsubcattitle_descript as $title => $descript) {
if ($descript != NULL) {
?>
<div class=”row”>
<div class=”col-xs-12″>
<p class=”titleSubCatg_title”>
<?php echo $title; ?>
</p>
<div>
<div class=”row”>
<div class=”col-xs-12″>
<p class=”titleSubCatg_title”>
<?php echo $descript; ?>
</p>
</div>
</div>
</div>
<?php
–> $querySubCatgDishTitle_DishPrice = “SELECT DishTitle, DishPrice FROM MainTblMenuItem INNER JOIN SubCategory ON FK_MenuItemSubCategoryId = PK_MenuItemSubCategoryId WHERE SubCategoryTitle = $title”;
$runSql2_qry1 = mysqli_query($connect, $querySubCatgDishTitle_DishPrice);
if ($runSql2_qry1) {
if (mysqli_num_rows($runSql2_qry1) > 0) {
while ($assocarrSubCatgDishTitles_MainDishPrices = mysqli_fetch_assoc($runSql2_qry1)) {
?>
I’ve used –> to indicate the loop variable and the –> to indicate it the query
How would one use the loop variable $title in the where clause of another query?