<?php 
/****************************************************************/
/*          e-mo.pl © 2017                                      */
/*          http://www.e-mo.com.pl                              */
/*          e-mail: info@e-mo.pl                                */
/*          produkt: Action2osCommerce                          */
/*          wersja: 1.9.5                                       */
/*          webserwis: oscGold                                  */
/*          sciezka: https://www.e-mo.com.pl/plikit,1606,51cc3f3a4b10c.php*/
/*          data: 2017-09-07                                    */
/*          godz: 13:19:53                                      */
/****************************************************************/


class db{

private $user='jotte_oscgold';
private $haslo='Qqryq1122';
public $schema='jotte_oscgold';
public $port='3306';
public $host='localhost';
	public $Conn = '';
	public $errMsg = '';
	public $errNo = 0;
	
	function __construct($_user,$_haslo, $_schema, $_host, $_port){
		
		try {
			$this->Conn = new PDO('mysql:host='.$_host.';port='.$_port.';dbname='.$_schema,
								$_user,
								$_haslo			
			);
			$this->Conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); 
			
			$sth = $this->Conn->prepare('SET Names \'utf8\'');
			
			$sth->execute();
			$sth = $this->Conn->prepare('SET CHARACTER SET utf8');
			$sth->execute();
			
		}	
		catch (Exception $e) {
  			$this->errMsg =$e->getMessage();
  			$this->errNo= $e->getCode();
  			
		}
	}
	public function Begin(){
		$this->Conn->beginTransaction();
	}	
	public function Commit(){		
		$this->Conn->commit();
	}
	public function Rollback(){	
		$this->Conn->rollBack();
	}

}

?>
