Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  namespace  App;
  3.  use PDO;
  4.  use PDOException;
  5.  class Connection{
  6.      protected $conn;
  7.      private $user ='root';
  8.      private $pass='';
  9.      public function __construct()
  10.      {
  11.          try {
  12.  
  13.            $this->conn=new PDO('mysql:host=localhost;dbname=crud67,$this->.user,$this->pass');
  14.  
  15.      }
  16.      catch(PDOException $e){
  17.      print "Error" . $e->getMessage() ."</br>;
  18.     die();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement