gmc1103 Posted 16 hours ago Share Posted 16 hours ago (edited) 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 16 hours ago by gmc1103 Quote Link to comment https://forums.phpfreaks.com/topic/326556-strange-result-in-pdofetch_assoc-result/ Share on other sites More sharing options...
requinix Posted 9 hours ago Share Posted 9 hours ago What does var_dump($result) show? Quote Link to comment https://forums.phpfreaks.com/topic/326556-strange-result-in-pdofetch_assoc-result/#findComment-1648130 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.