title: query does not work on php
body: <p>I have the following query that I'm trying to make but I cant get it to work, any advise?</p>
  
  <pre><code>function getPrelaciones($carnet){
  
  $result = ("SELECT mhm.Materia_codigo1 FROM Materia_has_Materia mhm, Materia m, (SELECT mha.Materia_codigo as materianovista FROM Materia_has_Alumno mha WHERE mha.Alumno_carnet = '%s')as n WHERE n.materianovista = mhm.Materia_codigo AND mhm.Materia_codigo1 != ' ' AND n.materianovista = m.codigo", $carnet);
  print json_encode($result);
  }
  </code></pre>