Jump to content

Recommended Posts

Captura de ecrã 2025-01-17 094327.png

Captura de ecrã 2025-01-17 094406.png

 

Hello

 

I'm having problems regardind the result of a query using PDO, my site have 2 different access, teacher and supervisor. Two supervisors have the same access but one show result and the other one no because of those "[]"

 $stmt = $DB_con->prepare("SELECT v.idVisita, 
                                                e.Escola, 
                                                p.Nome, 
                                                t.Turma,
                                                v.TipoTurma,
                                                v.Destino, 
                                                v.StartDate,
                                                v.EndDate, 
                                                v.TipoTransporte, 
                                                vt.alunosVisita, 
                                                vt.idTurma as idTurma, 
                                                v.TotalAluno,
                                                v.PdfVisita, 
                                                v.Avaliacao, 
                                                v.idProfessor, 
                                                v.Saida, 
                                                v.Chegada, 
                                                v.PlanoOcupacaoAlunos, 
                                                v.PlanoOcupacaoTurmas, 
                                                v.CustoEstadia, 
                                                v.CustoSeguro,
                                                v.CustoTransporte, 
                                                v.TipoSeguro, 
                                                v.TipoEstadia, 
                                                v.TipoTransporte, 
                                                v.idProfessor,
                                                v.Obs, 
                                                v.Areas, 
                                                v.Total,
                                                v.TipoEstadia, 
                                                v.TipoSeguro, 
                                                v.TipoTransporte, 
                                                v.Financiamento,
                                                vt.idTurma,
                                                v.PdfAvaliacao,
                                                v.Estado, 
                                                IF(v.Estado='1','DEF',IF(v.Estado='0','IND','AG')) as EstadoNum, 
                                                v.CustoIngressos, 
                                                v.TipoIngressos,
                                                v.haveClasses,
                                                d.Departamento,
                                                v.percent
                                                    FROM
                                                        visitas AS v
                                                        INNER JOIN escolas AS e ON (v.idEscola = e.idEscola)
                                                        INNER JOIN visitasturmas AS vt ON (v.idVisita = vt.idVisita)
                                                        INNER JOIN turmas AS t ON (vt.idTurma = t.idTurma)
                                                        INNER JOIN professores AS p ON (v.idProfessor = p.idProfessor)
                                                        INNER JOIN anosescolares AS ae ON (vt.idAnoEscolar = ae.idAnoEscolar)
                                                        INNER JOIN grupos g on p.idGrupo = g.idGrupo
                                                        INNER JOIN departamentos d on g.idDepartamento = d.idDepartamento
                                                        WHERE ae.Estado = 1 
                                                        ORDER BY v.idVisita,v.StartDate, t.Turma");
            $stmt->execute();
            $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
            echo json_encode($result);

Why?

How can i remove this?

 

 

Edited by gmc1103
Link to comment
https://forums.phpfreaks.com/topic/326556-strange-result-in-pdofetch_assoc-result/
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.