Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getDatabase()
- {
- // Connexion
- $host = "localhost";
- $dbName = "affylia";
- $login = "root";
- $password = "";
- try {
- $bdd = new PDO('mysql:host='.$host.';dbname='.$dbName.';charset=utf8', $login, $password, array(PDO::ATTR_ERRMODE => PDO:: ERRMODE_EXCEPTION));
- } catch (Exception $e) {
- $bdd = null;
- die('Erreur : ' . $e->getMessage());
- }
- return $bdd;
- }
Advertisement
Add Comment
Please, Sign In to add comment