include 'db_connection.php'; if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; // Prepare the SQL statement $stmt = $conn->prepare("INSERT INTO customers (name, email, phone) VALUES (?, ?, ?)"); $stmt->bind_param("sss", $name, $email, $phone); if ($stmt->execute()) { echo "Customer added successfully."; } else { echo "Error: " . $stmt->error; } // Close the statement and connection $stmt->close(); $conn->close(); }