public function executaSQL($_prStringSQL = '', $SQL = false, Sql $_prTransacao = null) { unset($this->StlRETORNO); if ($_prStringSQL == '') { $_prStringSQL = $this->StringSQL; } if ($this->LIMITFINAL > 0) { $_prStringSQL .= " LIMIT {$this->LIMITINICI}, {$this->LIMITFINAL}"; } $this->StringSQL = $_prStringSQL; $temTransacao = false; if ($_prTransacao != null) { $this->PRSCONEXAO = $_prTransacao->PRSCONEXAO; } else { if ($this->PRSCONEXAO == null) { $conexao = new Conexao(); $conexao->conectar(); $this->PRSCONEXAO = $conexao->getConexao(); $temTransacao = true; } } gravaLog($_prStringSQL); if ($SQL) { $retorno = @mysqli_query($this->PRSCONEXAO, $_prStringSQL); return $retorno; } else { $Aux = @mysqli_query($this->PRSCONEXAO, $_prStringSQL); for ($i = 0; $i < @mysqli_num_rows($Aux); $i++) { $this->StlRETORNO[$i] = @mysqli_fetch_assoc($Aux); } return arrayUtf8Enconde($this->StlRETORNO); } if ($temTransacao) { $conexao->desconectar(); } }
function __destruct() { Conexao::desconectar(); }