PHP购物车在会话中显示不同的产品

PHP购物车在会话中显示不同的产品,php,Php,我在orderdetails表中存储了一个临时会话值和产品id,以存储不同的产品项,以及如何在购物车页面中显示orderdetails值。附件将在以下情况下显示: 去除 形象 产品 价格 量 全部的 将查询更改为“在orderdetail.product\u id=products.product\u id上从orderdetailLEFT JOINproducts”,然后打印所有字段,如“谢谢…..工作正常:) <?php error_reporting(0); include("d

我在orderdetails表中存储了一个临时会话值和产品id,以存储不同的产品项,以及如何在购物车页面中显示orderdetails值。附件将在以下情况下显示:


去除
形象
产品
价格
量
全部的

将查询更改为“在orderdetail.product\u id=products.product\u id上从
orderdetail
LEFT JOIN
products
”,然后打印所有字段,如“谢谢…..工作正常:)
<?php
error_reporting(0);
include("db.php");
include("header.php"); 
session_start();
$session_id = session_id();  
?>

<form action="#" class="form1"> 
<div class="cart-table table-responsive mb-40">
    <table class="table">
        <thead>
            <tr>
                <th class="pro-remove">Remove</th>
                <th class="pro-thumbnail">Image</th>
                <th class="pro-title">Product</th>
                <th class="pro-price">Price</th>
                <th class="pro-quantity">Quantity</th> 
                <th class="pro-subtotal"> Total</th>
            </tr>
        </thead>
        <tbody> 
            <?php 
                $cartid = $_GET['proid'];  
                $sqlpd = mysql_query("select * from orderdetail where sessionid = '$session_id'")or die(mysql_error()); 
                while($getpd = mysql_fetch_array($sqlpd)){
                        $product_id = $getpd['product_id'];
                    ?> 
            <tr>
                <td class="pro-remove"><a href="javascript:void(0);"  name="cart_remove" id="cart_remove"><i class="fa fa-trash-o"></i></a></td>
                <td class="pro-thumbnail"> 
                    <img src="admin/<?php echo $getpd['medium_image'];?>" height="50" width="50">
                </td> 
                <td class="pro-title"><?php echo $getpd['product_id'];?></td>
                <td class="pro-price"><span><i class="fa fa-inr"></i><?php echo number_format($getpd['actual_price'],2);?>
        </span></td>

                <td class="pro-quantity">
                    <input type="number" class="cardqty-1" min="1" value="1" style="width:50px;">
                    <a href="javascript:void();" class="updatecart" data-id="1" data-prd_id="380" data-rowid="c2b5d53083a7597dd75ac36d9fd93581"><i class="fa fa-refresh" aria-hidden="true"></i></a>
                </td>
                <td class="pro-subtotal"><span><i class="fa fa-inr"></i><?php echo number_format($getpd['actual_price'],2);?></span></td>
            </tr>
            <?php }?>
        </tbody>
        <tfoot>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th >Sub Total</th>
                <th class="pro-subtotal text-center"><i class="fa fa-inr"></i><?php echo number_format($getpd['actual_price'],2);?></th>

            </tr>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th >GST(12%)</th>
                <th class="pro-subtotal text-center"><i class="fa fa-inr"></i><?php echo number_format($getpd['actual_price'],2);?></th>
            </tr>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th >Grand Total</th>
                <th class="pro-subtotal text-center"><i class="fa fa-inr"></i><?php echo number_format($getpd['actual_price'],2);?></th>
            </tr>
        </tfoot>
    </table>
</div>