Files
bolsa/php/api_modifier_ordre.php
2026-07-08 15:08:50 +00:00

20 lines
520 B
PHP

<?php
require_once __DIR__ . '/db.php';
header('Content-Type: application/json');
$db = (new App\Database\Database())->getConnection();
// Récupération des données POST
$id = $_POST['id'];
$nom = $_POST['nom'];
$ticker = $_POST['ticker'];
try {
$stmt = $db->prepare("UPDATE ordreGF SET nom = ?, ticker = ? WHERE id = ?");
$stmt->execute([$nom, $ticker, $id]);
echo json_encode(['success' => true]);
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
}