Advertisement
Alessandro_O

connection.php

Apr 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2.     class connection{
  3.  
  4.         private $dns;
  5.         private $user;
  6.         private $password;
  7.  
  8.         function __construct()
  9.         {
  10.             $this->dns = "mysql:host=localhost;dbname=cadastro";
  11.             $this->user = "root";
  12.             $this->password = "";
  13.  
  14.  
  15.             $connection = new PDO($this->dns,$this->user,$this->password);
  16.             $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  17.         }
  18.     }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement