correção query aluno
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user