Vereis tengo un problema con una aplicacion que estoy haciendo en php4, llevo solo unos dias programando en este lenguaje y no entiendo mucho
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Las tablas son las siguientes(resumidas, solo pondre campos necesarios, para relacionar las tablas):
ins_alum_curso_a(N_SOLICI_INTER,N_CUR_PRO) es esta la tabla que he de mostrar
ins_subplanes_a(N_SOLICI_INTER,N_SOLICI_EXTER)
cur(N_CUR_PRO,N_CUR_AJE,N_SOLICI_INTER)
Leyendo del xml obtengo N_SOLICI_EXTER y N_CUR_AJE
Bien he de mostrar N_SOLICI_INTER que leyendo el fichero xml y usando las tablas lo consigo hacer de esta manera:
while ($linea=fgets($fp,1024))
{
if (substr($linea,0,16)=="<ALUMNOS_CURSOS>")
{
$linea=fgets($fp,1024);
if(substr($linea,1,16)=="<N_SOLICI_EXTER>")
$N_SOLICI_EXT=substr($linea,17,-18);
$N_SOLICI= mysql_query("SELECT N_SOLICI_INTER FROM ins_subplanes_a where (N_SOLICI_EXTER='$N_SOLICI_EXT')" ,$c);
$registro = mysql_fetch_row($N_SOLICI);
foreach($registro as $clave=>$valor)
print("<td>".$valor."</td>");
Ahora es cuando viene mi problema, he de mostrar N_CUR_PRO y para ello debo usar N_CUR_AJE(lo obtengo leyendo del fichero xml) y el N_SOLICI_INTER que lo obtengo de la select puesta anteriormente, he intentado usar la misma formula que con la select anterior, pero me da un fallo, este es el codigo que he puesto:
$N_CUR=mysql_query("SELECT N_CUR_PRO FROM cur where (N_SOLICI_INTER='$valor' and N_CUR_AJE='$N_CUR_AJE')" ,$c);
$register = mysql_fetch_row($N_CUR);
foreach($register as $pass=>$value)
print("<td>".$value."</td>");
Este es el error que me da:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\apache\htdocs\parsear.php on line 213
Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\parsear.php on line 214
Bueno espero que me podais ayudar. Muchas gracias.
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)