Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $serverName = "localhost";
- $userName = "*here is my username*";
- $password = "*here is my password*";
- $dbName = "*here is my database name*";
- //utworzenie połączenia
- try {
- $connection = new PDO("mysql:host=$serverName;dbname=$dbName", $userName, $password);
- $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- }
- catch(PDOException $e)
- {
- echo "No connection: " . $e->getMessage();
- }
- $connection->query("SET NAMES utf8");
Add Comment
Please, Sign In to add comment