0

Here is the code

<?php 
    try{
        $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
        $bdd = new PDO('mysql:host=localhost;dbname=test', 'root', '',$pdo_options);
        $req = $bdd->prepare('INSERT INTO minichat (pseudo, message)
VALUES(?, ?)');
        $req->execute(array($_POST['pseudo'], $_POST['message']));header('Location: minichat.php');
    }catch(Exception $e){
        die('Erreur : '.$e->getMessage());
    }
?>
treyBake
  • 6,440
  • 6
  • 26
  • 57
Henintsoa
  • 1
  • 1

0 Answers0