I am working with two MySQL tables:
Table tb_cat_combos:
Table tb_productos_combos:
I would like to get the items from the second table with following output:
Bread
Large Bun
Small Bun(5")
Sides
French Fries
This is my current query:
$queryCombo = "SELECT pro.*, cat.nombre_cat FROM tb_productos_combos pro
LEFT JOIN tb_cat_combos cat ON pro.cat_combo = cat.id
ORDER BY cat.orden_cat ";
And this is how am I showing the query output:
if($statementCombo->execute())
{
$numero_opciones = 0;
$result_combo = $statementCombo->fetchAll();
foreach($result_combo as $row_combo)
{
if ($row_combo['origen_combo'] == $row['id']) {
$numero_opciones = $numero_opciones + 1;
$output .= '
<div class ="oculto" id="customDiv'.$row["id"].'" style="display:none;" class="answer_list" >
<div class="checkbox">
<label><input type="checkbox" data-nombre="'. $row_combo["nombre"] .'"
data-precio="'. $row_combo["precio"] .'" id="opcion'.$row["id"].'" class="opcion_cbox"
data-rowid="'. $row["id"] .'" value="">'.$row_combo['nombre'].' (+ $'.$row_combo['precio'].')</label>
</div>
</div>
';
}
}
}
What is the best way to get the needed output?
EDIT:
This is the current output:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…