Guest User

Untitled

a guest
May 14th, 2018
117
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.  
  3. class TutoDB {
  4.  
  5. private $host="127.0.0.1";
  6. private $user="root";
  7. private $pass="";
  8. public $banco="php_oo";
  9. private $sql;
  10.  
  11. function conectar(){
  12. $con = mysql_connect($this->host,$this->user,$this->pass) or die($this->erro(mysql_error()));
  13. return $con;
  14. }
  15.  
  16. function selecionarDB(){
  17. $sel = mysql_select_db($this->banco) or die($this->erro(mysql_error()));
  18. if($sel){
  19. return true;
  20. }else{
  21. return false;
  22. }
  23. }
  24.  
  25. }
  26.  
  27.  
  28. ?>
Add Comment
Please, Sign In to add comment