Good luck, I'm using PDO to run my querys
.
SQL:
SELECT Pessoa.IdPessoa, Pessoa.IdPessoa, Pessoa.Nome AS 'Nome', Pessoa.DataNascimento AS 'Nascimento' FROM Pessoa WHERE Pessoa.EstadoCivil = '1'
When I run this sql for example, which brings the IdPessoa
field twice, return the PDO using the
$result->fetchAll(PDO::FETCH_ASSOC);
Ignore one of the results and the query brings an array, but only with a IdPessoa
[0] => Array
(
[IdPessoa] => 7
[Nome] => Carlos Alberto Martins Barros
[Nascimento] =>
)
)
Is there anything to be done, so that the PDO does not eliminate this duplicity?
If you only use
$result->fetchAll();
It will bring duplicate results, but all fields with numeric indexes and indexes with the result name of Query
will not work.