當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Conexao::close方法代碼示例

本文整理匯總了PHP中Conexao::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP Conexao::close方法的具體用法?PHP Conexao::close怎麽用?PHP Conexao::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Conexao的用法示例。


在下文中一共展示了Conexao::close方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: excluir

 function excluir($objTarefa)
 {
     try {
         $sql = "DELETE FROM tarefas WHERE id =?";
         $stmt = $this->conex->prepare($sql);
         $stmt->bindValue(1, $objTarefa->id);
         $stmt->execute();
         Conexao::close();
         return "ok";
     } catch (PDOException $ex) {
         return $ex->getMessage();
     }
 }
開發者ID:jeremiaspereira,項目名稱:fazer-feito,代碼行數:13,代碼來源:TarefaDao.php

示例2: __destruct

 public function __destruct()
 {
     if ($this->Parent) {
         parent::close();
     }
 }
開發者ID:eriveltonguedes,項目名稱:atlas_ivs,代碼行數:6,代碼來源:bd.class.php

示例3: Conexao

$municipio = (int) $_POST['municipio'];
$espac = $_POST['espac'];
/* =================== LIMPA REQUISIÇÃO ======================================== */
$_GET = null;
$_POST = null;
$_REQUEST = null;
/* =================== FECHA LEITURA DAS VARIÁVEIS E LIMPEZA DA REQUISIÇÃO ===== */
if (eregi("^[0-9]+\$", $ano) && eregi("^[0-9]+\$", $municipio)) {
    include_once '../../../config/conexao.class.php';
    #instanciando o objeto
    $minhaConexao = new Conexao();
    #chamada ao metodo open que abra a conexao
    $con = $minhaConexao->open();
    //$show_query = "select var.nomecurto,varmun.valor from variavel as var left join valor_variavel_mun as varmun on var.id = varmun.fk_variavel where var.id = $varid and varmun.fk_municipio = $municipio and fk_ano_referencia = $ano";
    //$show_query = "select var.nomecurto,varmun.valor from variavel as var left join valor_variavel_mun as varmun on var.id = varmun.fk_variavel where var.id in (120,121,122,123) and varmun.fk_municipio = $municipio and fk_ano_referencia = $ano order by var.nomecurto";
    if ($espac == 'municipio') {
        $show_query = "select var.nomecurto,varmun.valor from variavel as var left join valor_variavel_mun as varmun on var.id = varmun.fk_variavel where var.id in (196,197,198,199) and varmun.fk_municipio = {$municipio} and fk_ano_referencia = {$ano} order by var.nomecurto";
    } else {
        if ($espac == 'estado') {
            $show_query = "SELECT var.nomecurto,varest.valor \n                              FROM variavel as var LEFT JOIN valor_variavel_estado as varest ON var.id = varest.fk_variavel \n                              WHERE var.id IN (196,197,198,199) AND varest.fk_estado = {$municipio} AND fk_ano_referencia = {$ano} ORDER BY var.nomecurto";
        }
    }
    $res = @pg_query($con, $show_query) or die("Nao foi possivel executar a consulta!");
    while ($linha = pg_fetch_array($res)) {
        echo "{$linha['0']}|{$linha['1']}|";
    }
    $minhaConexao->close();
}
?>

開發者ID:eriveltonguedes,項目名稱:atlas_ivs,代碼行數:29,代碼來源:consulta.php


注:本文中的Conexao::close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。