Advertisement
Guest User

Untitled

a guest
May 14th, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "username";
  4. $password = "password";
  5. $dbname = "myDB";
  6.  
  7.  
  8. $szychul = mysqli_connect($servername, $username, $password, $dbname);
  9. // Check connection
  10. if (!$szychul) {
  11.     die("Connection failed: " . mysqli_connect_error());
  12. }
  13.  
  14. $sql = "INSERT INTO NazwaTabeli (pole1, szychulgej)
  15. VALUES ('John', 'Doe')";
  16.  
  17. if (mysqli_query($szychul, $sql)) {
  18.     echo "New record created successfully";
  19. } else {
  20.     echo "Error: " . $sql . "<br>" . mysqli_error($szychul);
  21. }
  22.  
  23. mysqli_close($szychul);
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement