for (var i = 0; i < JSvar.length; i++) {
allTotal = parseFloat(allTotal) + parseFloat(document.getElementById('total' + JSvar[i].id_bills).value);
}
document.getElementById('sub_total').value = parseFloat(allTotal).toFixed(2);
for (var i = 0; i < JSvar.length; i++) {
if (JSvar[i].id_bills == idBills) {
JSvar[i].quantity = qty;
JSvar[i].total = total;
JSvar[i].sub_total = allTotal;
}
}
var JSvar_serialized = JSON.stringify(JSvar);
window.localStorage.setItem("Jsvar", JSvar_serialized);
var JSvar_deserialized = JSON.parse(localStorage.getItem("Jsvar"));
}
here is my code so i want to update Jsvar localStorage data into mysql database
$sql_update = "UPDATE bills SET rate='" . $_POST["rate"] . "', quantity='" . $_POST["qty"] . "', total='" . $_POST["total"] . "', sub_total='" . $_POST["sub_total"] . "', discount='" . $_POST["discount"] . "', total_amt='" . $_POST["total_amt"] . "', recieved_amt='" . $_POST["recieved_amt"] . "', balance='" . $_POST["balance_amt"] . "', updated_date='" . $_POST["date_id"] . "' WHERE invoice_number='" . $_POST["invoice_number"] . "' ";