SHARE
TWEET

Untitled

a guest May 19th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $servername = "localhost";
  3. $username = "username";
  4. $password = "password";
  5. $dbname = "id9639884_zupki";
  6.  
  7. // Create connection
  8. $conn = mysqli_connect($servername, $username, $password, $dbname);
  9. // Check connection
  10. if (!$conn) {
  11.     die("Connection failed: " . mysqli_connect_error());
  12. }
  13. if(isset($_GET["zupka"]) && isset($_GET["ocena"]) && isset($_GET["opis"]))
  14. {
  15.     $zupka = $_GET["zupka"];
  16.     $ocena = $_GET["ocena"];
  17.     $opis = $_GET["opis"];
  18.  
  19.     $sql = "INSERT INTO 'Oceny zupek' (Nazwa, Ocena, Opis)
  20.     VALUES ('".$zupka."', '".$ocena."', '".$opis."')";
  21.  
  22.     if ($conn->query($sql) === TRUE) {
  23.         echo "Dodano zupkę!";
  24.     } else {
  25.         echo "Error: " . $sql . "<br>" . $conn->error;
  26.     }
  27. } else
  28. {
  29.     echo "Error: brak argumentu";
  30. }
  31.  
  32. $conn->close();
  33. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top