title: mysql statement for getting data from 3 tables
body: <p>i have 3 tables for a quiz</p>
  
  <p><code>cursos</code>(quizes) that has an id as PK</p>
  
  <p><code>preguntas_cursos</code> (questions) that has an id as PK and has an id_curso as FK thats the same as the id in cursos (previous table)</p>
  
  <p>and theres a third table for the answers <code>opciones_preguntas_cursos</code> that has an id as PK and a FK <code>preguntas_cursos_id</code> that's the same as <code>preguntas_cursos_id</code> (previous table)</p>
  
  <p>i want to join this 3 together:</p>
  
  <p>here's the statement i am trying:</p>
  
  <pre><code>SELECT cursos.nombre_curso, pc.curso_id, pc.id AS preg_id, pc.pregunta, opc.id AS resp_id, opc.respuesta, opc.es_correcta 
  FROM preguntas_cursos AS pc, opciones_preguntas_cursos AS opc, cursos
  WHERE pc.id = opc.preguntas_cursos_id
  AND cursos.id = pc.curso_id            
  </code></pre>
  
  <p>but this query is just giving me a set of rows with only one id of <code>cursos</code>, its not showing them all</p>
  
  <p>what am i doing wrong, or whats the best way to accomplish what i am trying to do???</p>