Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database{
- private $host = "db59.grserver.gr:3306";
- private $db_name = "skspiros623949_wp_agropin_db";
- private $user = "skspi_guest";
- private $pass = "guest123";
- public $conn;
- function getConnection(){
- try{
- $this->conn = null;
- $this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->user, $this->pass);
- $this->conn->exec("set names utf8");
- }catch(PDOException $exception){
- echo "error" . $exception->getMessage();
- }
- return $this->conn;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement