Files
bolsa/php/api_rechercher_action.php

10 lines
337 B
PHP

<?php
require_once __DIR__ . '/db.php';
$isin = $_GET['isin'] ?? '';
$db = (new App\Database\Database())->getConnection();
$stmt = $db->prepare("SELECT * FROM actions WHERE isin = ?");
$stmt->execute([$isin]);
$action = $stmt->fetch(PDO::FETCH_ASSOC);
echo json_encode($action ? ['success' => true, ...$action] : ['success' => false]);