当前位置: 首页>>代码示例>>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;未经允许,请勿转载。