<?php
include 'config/connexion.php';

echo "=== Structure de la colonne policy_type ===\n";
$result = $conn->query('DESCRIBE policy_table');
while($row = $result->fetch_assoc()) {
    if($row['Field'] == 'policy_type') {
        echo "Column: " . $row['Field'] . "\n";
        echo "Type: " . $row['Type'] . "\n"; 
        echo "Null: " . $row['Null'] . "\n";
        echo "Default: " . $row['Default'] . "\n";
        break;
    }
}

echo "\n=== Test valeur POST ===\n";
echo "policy_type reçu: ";
var_dump($_POST['policy_type'] ?? 'NON_DEFINI');

echo "\n=== Derniers enregistrements ===\n";
$result = $conn->query('SELECT id, n_policy, policy_type FROM policy_table ORDER BY id DESC LIMIT 3');
while($row = $result->fetch_assoc()) {
    echo "ID: " . $row['id'] . ", Policy: " . $row['n_policy'] . ", Type: '" . $row['policy_type'] . "'\n";
}
?>