Advertisement
Guest User

Untitled

a guest
Mar 5th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2.  
  3. class Conexao{
  4. private $host = "localhost";
  5. private $user = "root";
  6. private $db = "indicseguros";
  7. private $pass = "";
  8. public $conn;
  9.  
  10. public function __construct(){
  11. try{
  12. $this->conn = new PDO("mysql:host=".$this->host.";dbname=".$this->db,$this->user,$this->pass);
  13. $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  14. return true;
  15. } catch(PDOException $e) {
  16. echo "ERRO: ".$e->getMessage();
  17. return false;
  18. }
  19. }
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement