Advertisement
Guest User

Untitled

a guest
Apr 5th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. var $Server="localhost";
  4. var $Username="root";
  5. var $Password="";
  6. var $Database="testeclass";
  7.  
  8. function __construct(){
  9. $this->Conectar();
  10. }
  11.  
  12. function Conectar(){
  13. if(!($conectar=mysql_connect($this->Server,$this->Username,$this->Password))){
  14. echo "Erro ao tentar abrir conexão";
  15. }else{
  16. if(!($con=mysql_select_db($this->Database,$conectar))){
  17. echo "Erro ao selecionar base de dados";
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement