Advertisement
Guest User

Untitled

a guest
Nov 11th, 2015
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <?php
  2.  
  3. $link = mysqli_connect("localhost", "root", "", "pistache");
  4. if ($link == false){
  5. die("Konnte nicht verbinden" . mysqli_connect_error());
  6. }
  7.  
  8. $text1 = mysqli_real_escape_string($link, $_POST['text1']);
  9. $text2 = mysqli_real_escape_string($link, $_POST['text2']);
  10. $text3 = mysqli_real_escape_string($link, $_POST['text3']);
  11. $text4 = mysqli_real_escape_string($link, $_POST['text4']);
  12. $text5 = mysqli_real_escape_string($link, $_POST['text5']);
  13. $text6 = mysqli_real_escape_string($link, $_POST['text6']);
  14. $text7 = mysqli_real_escape_string($link, $_POST['text7']);
  15. $datumvon = mysqli_real_escape_string($link, $_POST['datumvon']);
  16. $zeitbis = mysqli_real_escape_string($link, $_POST['zeitbis']);
  17. $wochentagmo = mysqli_real_escape_string($link, $_POST['wochentagmo']);
  18. $wochentagdi = mysqli_real_escape_string($link, $_POST['wochentagdi']);
  19. $wochentagmi = mysqli_real_escape_string($link, $_POST['wochentagmi']);
  20. $wochentagdon = mysqli_real_escape_string($link, $_POST['wochentagdon']);
  21. $wochentagfr = mysqli_real_escape_string($link, $_POST['wochentagfr']);
  22. $wochentagsa = mysqli_real_escape_string($link, $_POST['wochentagsa']);
  23. $wochentagso = mysqli_real_escape_string($link, $_POST['wochentagso']);
  24. $station1 = mysqli_real_escape_string($link, $_POST['station1']);
  25. $station2 = mysqli_real_escape_string($link, $_POST['station2']);
  26. $station3 = mysqli_real_escape_string($link, $_POST['station3']);
  27. $station4 = mysqli_real_escape_string($link, $_POST['station4']);
  28. $station5 = mysqli_real_escape_string($link, $_POST['station5']);
  29. $station6 = mysqli_real_escape_string($link, $_POST['station6']);
  30. $station7 = mysqli_real_escape_string($link, $_POST['station7']);
  31. $station8 = mysqli_real_escape_string($link, $_POST['station8']);
  32. $station9 = mysqli_real_escape_string($link, $_POST['station9']);
  33.  
  34. $sql = "INSERT INTO pistache_ice (Test1, Test2, Test3, Test4, Test5, Test6, Test7, `Datum von`, `Zeit bis`, `Wochentag MO`, `Wochentag DI`, `Wochentag MI`, `Wochentag Don`, `Wochentag FR`, `Wochentag SA`, `Wochentag SO`, `Test17`, `Station 2`, `Test19`, `Station 4`, `Station 5`, `Test22`, `Station 7`, `Station 8`, `Test25`)
  35. VALUES ('$text1', '$text2', '$text3', '$text4', '$text5', '$text6', '$text7', '$datumvon', '$zeitbis', '$wochentagmo', '$wochentagdi', '$wochentagmi', '$wochentagdon', '$wochentagfr', '$wochentagsa', '$wochentagso', '$station1', '$station2', '$station3', '$station4', '$station5', '$station6', '$station7', '$station8', '$station9')";
  36.  
  37.  
  38.  
  39. if(mysqli_query($link, $sql)){
  40. echo "Hat funktioniert";
  41. } else{
  42. echo "Hat nicht geklappt. Hier liegt der Fehler: " . mysqli_error($link);
  43.  
  44.  
  45.  
  46. }
  47. mysqli_close($link);
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement