Skip to content

Commit

Permalink
Resolução da issue #614
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielPintoSouza committed Jun 21, 2024
1 parent 79377d9 commit 0bf58b0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions html/contribuicao/php/conexao.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,18 @@ public function query($sql)
}

public function querydados($sql){
//Realiza a pesquisa
$dados = $this->pdo->query($sql);
$this->array_dados = $dados->fetch();

//Atribui o número de resultados
$this->rows = $dados->rowCount();
$this->array_dados = $dados->fetchAll();

//Verifica o número de resultados para escolher o modo de retorno adequado
if($this->rows > 1){
$this->array_dados = $dados->fetchAll();
}else{
$this->array_dados = $dados->fetch();
}
}

public function rows()
Expand Down

0 comments on commit 0bf58b0

Please sign in to comment.