Advertisement
GWibisono

ADA3WRAFAS ASFASGAS

Jan 5th, 2014
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. $sid = session_id();
  3. $sql = mysql_query("SELECT * FROM keranjang, product WHERE id_session='".$sid."' AND keranjang.id_product=product.id");
  4. $hitung = mysql_num_rows($sql);
  5. if ($hitung < 1){
  6. echo"<script>window.alert('Keranjang Masih Kosong....');
  7. window.location=('index.php')</script>";
  8. }
  9. else {
  10. while($data=mysql_fetch_array($sql)){
  11. $subtotal=$data['price']*$data['qty'];
  12. echo $subtotal;
  13. $TOTAL+=$subtotal;
  14. }
  15. }
  16. echo $TOTAL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement