= ".webpage_detail_func("flag_magazineinfo_show")." where magazine.magflag > ".webpage_detail_func("flag_magazine_hide")." and magazine.magflag <= ".$magazineflag." and magazine.magid = ".$magid; $result = select_data_func($sql); $totalRow = mysql_num_rows($result); if($totalRow>0){ $row = mysql_fetch_array($result); $magazineinfoname = stripslashes($row['magInfoName']); $maginfoid = $row['magInfoId']; $magcount = $row['magcount']; }else{ echo ""; exit; } }else{ echo ""; exit; } $sql = "select * from customerstock where productid = ".$magid; $result = select_data_func($sql); $totalRow = mysql_num_rows($result); if($totalRow>0){ $row = mysql_fetch_array($result); $unitprice = $row['sellprice']; $qtyorder = 1; $totalprice = $unitprice * $qtyorder; }else{ $unitprice = 0; $qtyorder = 1; $totalprice = 0; } //บันทึกลง shopping cart $sql = "insert into shoppingcart values ('', '".session_id()."', now(), $magid, 0, $unitprice, $qtyorder, $totalprice, '".$flagarray[0]."', '".$flagarray[1]."')"; $shoppingid = manage_data_func($sql); if($shoppingid <= 0){ echo ""; exit; } if($shoppingid > 0){ echo ""; } ?>