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

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

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

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

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