setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $totalAmount = $_POST['totalAmount']; $tenure = $_POST['tenure']; $frequency = $_POST['frequency']; $bookingDate = $_POST['bookingDate']; $paymentMode = $_POST['paymentMode']; $salesAgent = $_POST['salesAgent']; $adminNote = $_POST['adminNote']; $invoiceId = $_POST['invoiceId']; $customerName = $_POST['customerName']; $customerAddress = $_POST['customerAddress']; $marketingAgents = $_POST['marketingAgent']; $marketingAgentList = implode(", ", $marketingAgents); $item = $_POST['item']; $description = $_POST['description']; $quantity = $_POST['quantity']; $rate = $_POST['rate']; $discountAmount = $_POST['discountAmount']; // Update invoice table $stmt2 = $db->prepare("UPDATE invoice SET customerName = :customerName, address = :address, invoiceDate = :invoiceDate, paymentMode = :paymentMode, salesAgent = :salesAgent, marketingAgent = :marketingAgent, item = :item, description = :description, adminNote = :adminNote, discountAmount = :discountAmount, totalAmount = :totalAmount WHERE customerId = :customerId AND invoiceId = :invoiceId"); $stmt2->bindParam(':customerId', $_GET['customerId']); $stmt2->bindParam(':invoiceId', $invoiceId); $stmt2->bindParam(':customerName', $customerName); $stmt2->bindParam(':address', $customerAddress); $stmt2->bindParam(':invoiceDate', $bookingDate); $stmt2->bindParam(':paymentMode', $paymentMode); $stmt2->bindParam(':salesAgent', $salesAgent); $stmt2->bindParam(':marketingAgent', $marketingAgentList); $stmt2->bindParam(':item', $item); $stmt2->bindParam(':description', $description); $stmt2->bindParam(':adminNote', $adminNote); $stmt2->bindParam(':discountAmount', $discountAmount); $stmt2->bindParam(':totalAmount', $totalAmount); $stmt2->execute(); echo '