Guest User

Untitled

a guest
May 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. $serverName = "localhost";
  3. $userName = "*here is my username*";
  4. $password = "*here is my password*";
  5. $dbName = "*here is my database name*";
  6. //utworzenie połączenia
  7. try {
  8. $connection = new PDO("mysql:host=$serverName;dbname=$dbName", $userName, $password);
  9. $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. }
  11. catch(PDOException $e)
  12. {
  13. echo "No connection: " . $e->getMessage();
  14. }
  15. $connection->query("SET NAMES utf8");
Add Comment
Please, Sign In to add comment