I am making hotel online order system in php. I am having issue when i have added one item in the cart the original price is 2$ but with that there were 2 more options (1) add cheese (2) add more chicken.
it is showing the main item and price watever it is. But it is showing only one extra option cheese and i have selected both.
fixed it - my updated code is below:
<?php
$rest_menuC = mysql_query("select * from menu_items where status = 1 order by id");
while ($mitemC = mysql_fetch_array($rest_menuC)){
$mitem_idC = $mitemC['id'];
$mitem_enC = $mitemC['ename'];
$mitem_anC = $mitemC['aname'];
$mitem_fnC = $mitemC['filename'];
$mitem_ssC = $mitemC['status'];
$order_temp = mysql_query("select * from temp_cart where item_id = '".$mitem_idC."' order by id");
while ($torder = mysql_fetch_array($order_temp)) {
$prITTD = $torder['id'];
$prITTC = $torder['item_id'];
$prIDTC = $torder['price_id'];
$qtyT = $torder['qty'];
$pc1 = $torder['pc1'];
$pc2 = $torder['pc2'];
$order_tempCHP = mysql_query("select * from choice_price
WHERE
id='".$pc1."' OR id='".$pc2."' OR id='".$pc3."' OR id='".$pc4."' OR id='".$pc5."' OR id='".$pc6."' OR
id='".$pc7."' OR id='".$pc8."' OR id='".$pc9."' OR id='".$pc10."' OR id='".$pc11."' OR id='".$pc12."'
AND item_id = '".$prITTC."'");
$toarder = mysql_num_rows($order_tempCHP);
while ($torderCP = mysql_fetch_assoc($order_tempCHP)) {
$CPid = $torderCP['id'];
$CPenm = $torderCP['ename'];
$CPicd = $torderCP['choice_id'];
$CPitd = $torderCP['item_id'];
$CPlpr = $torderCP['price'];
if ($toarder == 1){
?>
<span class="quantity"><font color="red" style="font-weight:bold;">Choices # <?php echo $CPicd; ?></font></span><br>
<span class="quantity"> <?php echo $CPenm; ?> # <?php echo $CPlpr; ?></span>
<?php }else{ ?>
<span class="quantity"><font color="red" style="font-weight:bold;">Choices # <?php echo $CPicd; ?></font></span><br>
<span class="quantity"> <?php echo $CPenm; ?> # <?php echo $CPlpr; ?></span><br>
<?php } } ?>