ajout d'une route de type post fonctionnelle
continuous-integration/drone/push Build is failing Details

API
Vincent ASTOLFI 2 years ago
parent f1124e311d
commit f8caddc10d

@ -31,7 +31,7 @@ $app->get('/Inscrit', function(Request $request, Response $response){
}); });
$app->post('/Inscrit/one', function(Request $request, Response $response,array $args){ $app->post('/Inscrit/one', function(Request $request, Response $response,array $args){
$mail = $request->getParsedBody(); $mail = $request->getParsedBody()["email"];
$query = 'SELECT * FROM Inscrit WHERE mail=:mail'; $query = 'SELECT * FROM Inscrit WHERE mail=:mail';
try{ try{
@ -41,6 +41,7 @@ $app->post('/Inscrit/one', function(Request $request, Response $response,array $
$stmt = $conn->prepare($query); $stmt = $conn->prepare($query);
$stmt->bindValue(':mail', $mail, PDO::PARAM_STR); $stmt->bindValue(':mail', $mail, PDO::PARAM_STR);
$stmt->execute();
$inscrit = $stmt->fetchAll(PDO::FETCH_OBJ); $inscrit = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null; $db = null;

Loading…
Cancel
Save