Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['submit'])) {
  4. $error = "";
  5. $title = $_POST['title'];
  6. $singer = $_POST['singer'];
  7. if (!$error) {
  8. if ($title != "" && $singer != "") {
  9. $stmt = $con->prepare("INSERT INTO DATABASE (title, singer) VALUES (:title, :singer)");
  10. $stmt->bindValue(':title', $title);
  11. $stmt->bindValue(':singer', $singer);
  12. $result = $stmt->fetch();
  13. if ($result == false) {
  14. $error = "Bitte fülle alle Felder aus!";
  15. } else {
  16. if (isset($result)) {
  17. $successfully = "Successfully";
  18. }
  19. }
  20. }
  21. }
  22. }
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement