Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. class Database{
  3. private $host = "db59.grserver.gr:3306";
  4. private $db_name = "skspiros623949_wp_agropin_db";
  5. private $user = "skspi_guest";
  6. private $pass = "guest123";
  7. public $conn;
  8.  
  9. function getConnection(){
  10. try{
  11. $this->conn = null;
  12. $this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->user, $this->pass);
  13. $this->conn->exec("set names utf8");
  14. }catch(PDOException $exception){
  15. echo "error" . $exception->getMessage();
  16. }
  17. return $this->conn;
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement