本文整理汇总了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();
}
}
示例2: __destruct
public function __destruct()
{
if ($this->Parent) {
parent::close();
}
}
示例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();
}
?>