Advertisement
Guest User

connect

a guest
Jun 2nd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $username = "root";
  5. $password = "";
  6. $dbname = "rejestracja";
  7. header('Content-Type: text/html; charset=utf-8');
  8. // Create connection
  9. $conn = mysqli_connect("localhost", $username, $password, $dbname);
  10. // Check connection
  11. if (!$conn) {
  12.     die("Connection failed: " . mysqli_connect_error());
  13.    
  14. }
  15.  
  16. mysqli_query($conn,"SET NAMES utf8");
  17. mysqli_query($conn,"SET CHARACTER_SET utf8_unicode_ci");
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement