correção query aluno

This commit is contained in:
Reginaldo
2023-06-14 12:25:16 -03:00
parent 38cbb4dc8c
commit 92ca515d7e
4 changed files with 42 additions and 2 deletions

View File

@@ -26,6 +26,27 @@ class Controller extends DBA{
//caso o id não foi passado recebe essa mensagem
die('informação incompleta...');
}
}
public function getAlunos($NR_LOGRADOURO){
//CRIADO PARA TESTE COM PARAMETRO
if(!$NR_LOGRADOURO==''){
$this->sql = "SELECT * FROM ALUNO WHERE NR_LOGRADOURO = ?";
$this->stmt = self::$inst->prepare($this->sql);
$this->stmt->bindValue(1,$NR_LOGRADOURO);
$this->stmt->execute();
$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
return $this-> res;
}else{
//caso o id não foi passado recebe essa mensagem
die('informação incompleta...');
}
//FUNCIONANDO PARA TODA A TABELA ALUNO
//$this->sql = "SELECT * FROM ALUNO";
//$this->stmt = self::$inst->prepare($this->sql);
//$this->stmt -> execute();
//$this->res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
//print_r($this->res);
//return $this->res;
}
}