Advertisement
Guest User

Pierre

a guest
Oct 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. $base = new PDO('mysql:host=localhost;dbname=chat_code_bzh;charset=utf8', 'root', '');
  3. $requete= $base->prepare('INSERT INTO historique_discussion (nom, email, message) VALUES (:nom, :email, :message)');
  4. $requete->execute(array(
  5.  
  6. 'nom' => $_POST['pseudotxt'],
  7. 'email' => $_POST['mailtxt'],
  8. 'message' => $_POST['messagetxt'],
  9. ));
  10.  
  11.  
  12. $reponse = $base->query ('SELECT * FROM historique_discussion');
  13. while ($discussion = $reponse->fetch()) {
  14.  
  15. echo '<div>';
  16. echo $discussion['nom']." ". $discussion['email']." ". $discussion['message'];
  17. echo '</div>';
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement