gmc1103 Posted September 1, 2020 Share Posted September 1, 2020 (edited) Hello I'm having prblem regarding this query, it gives me the following error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':idCursos' at line 12 The query is the following select c.idPlan, cD.disciplina, cM.moduloUfcd, p.Nome, t.Turma, a.Ano, c2.curso, c.validPlan, c.planificacao, c.dataLimite, c.idProfessor, c.pdf,c.inicio,c.fim,c.objetivos,c.conteudos,c.competencias, c.estrategias, c.recursos, c.avaliacao,c.criado from cpDiscProfessores c inner join cpDisciplinas cD on c.idcpDisciplinas = cD.idCpDisciplinas inner join cpModulos cM on c.idCpModulos = cM.idCpModulos inner join professores p on c.idProfessor = p.idProfessor left join turmas t on c.idTurma = t.idTurma inner join anosescolares a on c.idAnoEscolar = a.idAnoEscolar left join cursos c2 on c.idCursos = c2.idCursos where a.Estado = 1 AND c2.idCursos=:idCursos"); $stmt->bindparam(":idCursos", $idCursos, PDO::PARAM_INT Ok, this query accept one pamater, and i have checked it is not empty array(4) { ["total"]=> string(1) "1" [0]=> string(1) "1" ["idCursos"]=> string(1) "1" [1]=> string(1) "1" } IdCursos: 1 isDC: 1 SOLVED: copy/paste and didn't see i was using "query" instead of "prepare" Edited September 1, 2020 by gmc1103 Quote Link to comment 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.