Advertisement
Guest User

Untitled

a guest
Oct 18th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php class Banco
  2. {
  3. private $_host = 'localhost';
  4. private $_user = 'root';
  5. private $_pass = 'usbw';
  6. private $_database = 'funilaria';
  7. public $_con;
  8.  
  9. function __construct()
  10. {
  11. $this->conecta();
  12. }
  13.  
  14. function conecta()
  15. {
  16. $_con = mysql_connect($this->_host, $this->_user, $this->_pass) or die("Erro ao conectar ao servidor &raquo; " . mysql_error());
  17. $_con = mysql_select_db($this->_database) or die("Erro ao selecionar o Banco de Dados &raquo; " . mysql_error());
  18. return $_con;
  19. }
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement