$id = $_POST["id"];
$prevread = $_POST["prev"];
$presread = $_POST["pres"];
$getPrev = (int)$prevread;
$getPres = (int)$presread;
$totalcons = (int)$_POST[$getPres - $getPrev];
$sql = "UPDATE con_billing SET totalConsumed ='$totalcons' WHERE con_id='$id';