Advertisement
Guest User

Untitled

a guest
Jan 15th, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3.   class dbConnect {
  4.  
  5.     private $username = "root";
  6.     private $password = "";
  7.  
  8.     public function __construct($username, $password) {
  9.       $this->username = $username;
  10.       $this->password = $password;
  11.     }
  12.  
  13.     public function connect($username, $password) {
  14.       $conn = new PDO('mysql:host=localhost;dbname=sequencemtg', $username, $password);
  15.     }
  16.  
  17.   }
  18.  
  19.   $username = "root";
  20.   $password = "";
  21.   $conn = new PDO('mysql:host=localhost;dbname=sequencemtg', $username, $password);
  22.   $test = new dbConnect($username, $password);
  23.   $test->connect($username, $password);
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement