本文整理匯總了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();
}
?>