Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class dbConnection {
- protected $db_conn;
- public $db_name = 'red_sec_net';
- public $db_user = 'root';
- public $db_pass = '';
- public $db_host = 'localhost';
- function connect(){
- try{
- $this->db_conn = new PDO("mysql:host=$this->db_host;dbname=$this->db_name;",$this->db_user,$this->db_pass);
- $this->db_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- return $this->db_conn;
- $this->conn = null;
- }catch(PDOException $e){
- die('failed to connect to database');
- }
- }
- }
- ?>
- Cannot redeclare class dbConnection in C:wamp64wwwredsecclassesclass.database.php on line 3
- class ManageUsers {
- public $link;
- function __construct(){
- $db_connection = new dbConnection();
- $this->link = $db_connection->connect();
- return $this->link;
- $this->link = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement