Guest User

Untitled

a guest
Oct 21st, 2016
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "janekoda1423";
  5. $dbname = "Test";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9.  
  10. // Check connection
  11. if ($conn->connect_error) {
  12.     die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. // prepare and bind
  16. $stmt = $conn->prepare("INSERT INTO MyGuests (zglaszajacy, zglaszany, powod) VALUES (?, ?, ?)");
  17. $stmt->bind_param("sss", $zglaszajacy, $zglaszany, $powod);
  18.  
  19. // set parameters and execute
  20. $zglaszajacy = $_POST["gracz"];
  21. $zglaszany = $_POST["z"];
  22. $powod = $_POST["powod"];
  23. $stmt->execute();
  24.  
  25. echo "New records created successfully";
  26.  
  27. $stmt->close();
  28. $conn->close();
  29. ?>
Add Comment
Please, Sign In to add comment