diff --git a/class.DBPDO.php b/class.DBPDO.php index a1322d5..ba17970 100644 --- a/class.DBPDO.php +++ b/class.DBPDO.php @@ -19,9 +19,7 @@ function prep_query($query){ function connect(){ if(!$this->pdo){ - $dsn = 'mysql:dbname=' . DATABASE_NAME . ';host=' . DATABASE_HOST.';charset=utf8'; - $user = DATABASE_USER; - $password = DATABASE_PASS; + include('connection.php'); try { $this->pdo = new PDO($dsn, $user, $password, array(PDO::ATTR_PERSISTENT => true)); diff --git a/connection.php b/connection.php new file mode 100644 index 0000000..06d7350 --- /dev/null +++ b/connection.php @@ -0,0 +1,10 @@ +$dsn = 'mysql:dbname=' . DATABASE_NAME . ';host=' . DATABASE_HOST.';charset=utf8'; +$user = DATABASE_USER; +$password = DATABASE_PASS; + +/*You this line to make code simple : + +include('connection.php'); + +This will help in reading and understanding code easily +*/