本文整理汇总了PHP中Conexao::closeConexao方法的典型用法代码示例。如果您正苦于以下问题:PHP Conexao::closeConexao方法的具体用法?PHP Conexao::closeConexao怎么用?PHP Conexao::closeConexao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conexao
的用法示例。
在下文中一共展示了Conexao::closeConexao方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autentica
public function autentica($login, $senha)
{
$conexao = new Conexao();
$tabelaLogin = "sistutor.login";
$dbCon = $conexao->getConexao();
$sql = "select * from " . self::$tabela . " join {$tabelaLogin} on {$tabelaLogin}.id_login = " . "gestor.login " . "where {$tabelaLogin}.login = \$1 and " . "{$tabelaLogin}.senha = \$2";
$result = pg_query_params($dbCon, $sql, array($login, $senha));
if (pg_fetch_assoc($result)) {
$conexao->closeConexao();
return true;
} else {
$conexao->closeConexao();
return false;
}
}
示例2: update
function update($polo)
{
$conexao = new Conexao();
$dbCon = $conexao->getConexao();
$sql = "update " . self::$tabela . " set nome=\$1, cidade=\$2, uf=\$3 where id_polo=\$4";
$params = array($polo->getNome(), $polo->getCidade(), $polo->getEstado(), $polo->getId());
pg_query_params($dbCon, $sql, $params);
$conexao->closeConexao();
}
示例3: daoFetchAll
public function daoFetchAll($query, $params = 0)
{
$conexao = new Conexao();
$connection = $conexao->getConexao();
if ($params) {
$result = pg_query_params($connection, $query, $params);
} else {
$result = pg_query($connection, $query);
}
$conexao->closeConexao();
return pg_fetch_all($result);
}
示例4: getTipos
function getTipos()
{
$conexao = new Conexao();
$dbCon = $conexao->getConexao();
$sql = "select * from sistutor.tipo_curso";
$result = pg_query($dbCon, $sql);
$tarefas = array();
while ($linha = pg_fetch_assoc($result)) {
array_push($tarefas, $linha);
}
$conexao->closeConexao();
return $tarefas;
}
示例5: listByTutor
function listByTutor($tutor)
{
$conexao = new Conexao();
$tutor_disciplina = "sistutor.tutor_disciplina";
$dbCon = $conexao->getConexao();
//criar join com curso
$sql = "select id_disciplina as disciplina from {$tutor_disciplina} where id_tutor=\$1";
$result = pg_query_params($dbCon, $sql, array($tutor->getTutorId()));
$disciplinas = array();
while ($linha = pg_fetch_assoc($result)) {
$id = $linha['disciplina'];
$disciplina = $this->getById($id);
array_push($disciplinas, $disciplina);
}
$conexao->closeConexao();
return $disciplinas;
}
示例6: insere
function insere($tarefa)
{
$conexao = new Conexao();
$dbCon = $conexao->getConexao();
if ($tarefa->getDataHora() != "") {
$sql = "insert into tarefa(nome,descricao,data_hora, cor, imagem) values('" . $tarefa->getNome() . "','" . $tarefa->getDescricao() . "','" . $tarefa->getDataHora() . "','" . $tarefa->getCor() . "','" . $tarefa->getImagem() . "') ";
} else {
$sql = "insert into tarefa(nome,descricao, cor, imagem) values('" . $tarefa->getNome() . "','" . $tarefa->getDescricao() . "','" . $tarefa->getCor() . "','" . $tarefa->getImagem() . "') ";
}
pg_query($dbCon, $sql);
$conexao->closeConexao();
}
示例7: addTutorDisciplina
function addTutorDisciplina($id_tutor, $id_disciplina)
{
$conexao = new Conexao();
$tutor_disciplina = "sistutor.tutor_disciplina";
$dbCon = $conexao->getConexao();
$sql = "insert into {$tutor_disciplina} (id_tutor, id_disciplina, dt_inicio) values " . " (\$1, \$2, now())";
pg_query_params($dbCon, $sql, array($id_tutor, $id_disciplina));
$conexao->closeConexao();
}