Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = mysqli_connect("localhost", "root", "", "pistache");
- if ($link == false){
- die("Konnte nicht verbinden" . mysqli_connect_error());
- }
- $text1 = mysqli_real_escape_string($link, $_POST['text1']);
- $text2 = mysqli_real_escape_string($link, $_POST['text2']);
- $text3 = mysqli_real_escape_string($link, $_POST['text3']);
- $text4 = mysqli_real_escape_string($link, $_POST['text4']);
- $text5 = mysqli_real_escape_string($link, $_POST['text5']);
- $text6 = mysqli_real_escape_string($link, $_POST['text6']);
- $text7 = mysqli_real_escape_string($link, $_POST['text7']);
- $datumvon = mysqli_real_escape_string($link, $_POST['datumvon']);
- $zeitbis = mysqli_real_escape_string($link, $_POST['zeitbis']);
- $wochentagmo = mysqli_real_escape_string($link, $_POST['wochentagmo']);
- $wochentagdi = mysqli_real_escape_string($link, $_POST['wochentagdi']);
- $wochentagmi = mysqli_real_escape_string($link, $_POST['wochentagmi']);
- $wochentagdon = mysqli_real_escape_string($link, $_POST['wochentagdon']);
- $wochentagfr = mysqli_real_escape_string($link, $_POST['wochentagfr']);
- $wochentagsa = mysqli_real_escape_string($link, $_POST['wochentagsa']);
- $wochentagso = mysqli_real_escape_string($link, $_POST['wochentagso']);
- $station1 = mysqli_real_escape_string($link, $_POST['station1']);
- $station2 = mysqli_real_escape_string($link, $_POST['station2']);
- $station3 = mysqli_real_escape_string($link, $_POST['station3']);
- $station4 = mysqli_real_escape_string($link, $_POST['station4']);
- $station5 = mysqli_real_escape_string($link, $_POST['station5']);
- $station6 = mysqli_real_escape_string($link, $_POST['station6']);
- $station7 = mysqli_real_escape_string($link, $_POST['station7']);
- $station8 = mysqli_real_escape_string($link, $_POST['station8']);
- $station9 = mysqli_real_escape_string($link, $_POST['station9']);
- $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`)
- 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')";
- if(mysqli_query($link, $sql)){
- echo "Hat funktioniert";
- } else{
- echo "Hat nicht geklappt. Hier liegt der Fehler: " . mysqli_error($link);
- }
- mysqli_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement