I am looking to insert the web_salescart
table:
$insert_row = $conn->query(
"INSERT INTO web_salescart (cartnumber, branchcode, stockid, qty, price, descr, salesman, date, time, brname,discount)
VALUES ('".$_SESSION['CART']."', '".$_SESSION['BRANCHCODE']."', '".$item_data['stockid']."', '".$item_data['qty']."', '".$item_data['unit_price']."', '".mysql_real_escape_string($item_data['description'])."', '".$_SESSION['salescode']."', '".date("m-d-y")."', '".date("g:i a")."', '".mysql_real_escape_string($_SESSION['BRNAME'])."','".$item_data['discount']."')");
Here $item_data['discount']
is updating 33%. I need to update it as 0.33 in web_salescart table and 33% is the display figure. Can I use an update statement right after the INSERT so that $item_data['discount'] is divided by 100?