Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sid = session_id();
- $sql = mysql_query("SELECT * FROM keranjang, product WHERE id_session='".$sid."' AND keranjang.id_product=product.id");
- $hitung = mysql_num_rows($sql);
- if ($hitung < 1){
- echo"<script>window.alert('Keranjang Masih Kosong....');
- window.location=('index.php')</script>";
- }
- else {
- while($data=mysql_fetch_array($sql)){
- $subtotal=$data['price']*$data['qty'];
- echo $subtotal;
- $TOTAL+=$subtotal;
- }
- }
- echo $TOTAL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement