<?

session_start();
      
      error_reporting(0);
      
if(mysql_connect('localhost','ava66_test','test')) {
    
if(mysql_select_db('ava66_test')) {
        
       mysql_query('SET NAMES UTF8');
        
    }
    else
    {
        
    
    }
    
  }
  else
  {
    
    
  }

  $config = array ('dbhost'=>'localhost','dbname'=>'ava66_test',
                  'dbuser'=>'ava66_test','dbpass'=>'test');

    $options = array( PDO:: MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
$dbh = new PDO ("mysql:host=localhost;dbname=ava66_test",'ava66_test','test',$options);

    class  DB {
        private $dbData;

        function __construct ($dbData){
            $this->db = $dbData;
        }

        function query($SQL,$ARGS){
            $stmt = $this->db->prepare($SQL);
            $stmt->execute($ARGS);
            return $stmt;
        }

        function fetch ($query,$args)
    {
        $stmt = $this->query($query,$args);
        return $data = $stmt->fetch(PDO::FETCH_ASSOC);
    }
    }

