Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class TutoDB {
- private $host="127.0.0.1";
- private $user="root";
- private $pass="";
- public $banco="php_oo";
- private $sql;
- function conectar(){
- $con = mysql_connect($this->host,$this->user,$this->pass) or die($this->erro(mysql_error()));
- return $con;
- }
- function selecionarDB(){
- $sel = mysql_select_db($this->banco) or die($this->erro(mysql_error()));
- if($sel){
- return true;
- }else{
- return false;
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment