<?php
// Include the database connection
include 'db_connection.php';

$description = $_POST['description'];
$amount = $_POST['amount'];
$date = $_POST['date'];

$query = "INSERT INTO liabilities (description, amount, date) VALUES (?, ?, ?)";
$stmt = $conn->prepare($query);
$stmt->bind_param("sds", $description, $amount, $date);
$stmt->execute();

if ($stmt->affected_rows > 0) {
    echo "Liability added successfully.";
} else {
    echo "Error adding liability.";
}

$stmt->close();
$conn->close();
?>
