Advertisement
Guest User

Untitled

a guest
Nov 6th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php
  2. $link = mysqli_connect("localhost", "root", "", "pistache");
  3. if ($link == false){
  4. die("Konnte nicht verbinden" . mysqli_connect_error());
  5. }
  6.  
  7. $text1 = mysqli_real_escape_string($link, $_POST['text1']);
  8. $text2 = mysqli_real_escape_string($link, $_POST['text2']);
  9. $text3 = mysqli_real_escape_string($link, $_POST['text3']);
  10. $text4 = mysqli_real_escape_string($link, $_POST['text4']);
  11. $text5 = mysqli_real_escape_string($link, $_POST['text5']);
  12. $text6 = mysqli_real_escape_string($link, $_POST['text6']);
  13.  
  14. $sql = "INSERT INTO pistache_ice (Test1, Test2, Test3, Test4, Test5, Test6) VALUES ('$text1', '$text2', '$text3', '$text4', '$text5')";
  15. if(mysqli_query($link, $sql)){
  16. echo "Hat funktioniert";
  17. } else{
  18. echo "Hat nicht geklappt. Hier liegt der Fehler: " . mysqli_error($link);
  19. }
  20. mysqli_close($link);
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement