0){ $new_qty = $asc_check['qty'] + $qty; $new_price = $new_qty * $prodprice; $update = "update shop_cart set qty='$new_qty', totprice='$new_price' where productid = '$id' and session_id='".$browsessionid."'"; mysql_query($update); }else{ $totprice=$qty * $prodprice; $res=mysql_query("insert into shop_cart(`user_id`,`session_id`,`productid`, `qty`, `price`,`totprice`) values('".$_SESSION['id']."','$browsessionid','$id','1','".$_REQUEST['prodprice']."','".$totprice."')"); } } $sql="select sum(qty) as qtys from shop_cart where session_id='".$browsessionid."' "; $res=mysql_query($sql); $residue = mysql_fetch_array($res); $rows=mysql_num_rows($res); $objqrynewsubee = "SELECT SUM(totprice) AS amtTotal FROM shop_cart where session_id='$browsessionid'"; $objResultnewsubee = mysql_query($objqrynewsubee); $Fetchnewww = mysql_fetch_array($objResultnewsubee); $subtotal=$Fetchnewww['amtTotal']; ?>