Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/06/2004, 07:52
omoranya
 
Fecha de Ingreso: junio-2004
Mensajes: 19
Antigüedad: 19 años, 10 meses
Puntos: 0
Problema con consulta

Hola tengo problemas a la hora de realizar consultas sin saber el porque
cuando hago una lista desplegables con los registros que esxisten de ese campo y uno unos cuantas listas , no me cargo todas, es mas hago una solo y no me carga todos los registros, mi base de datos es de 12500 registros , es posible que me pete por algo pero no se que ciertamente, en otro ordenador me funcionaba

el php es el siguiente
Código PHP:
<?php
   
   
include("conex.phtml");
   
$link=Conectarse();
   
?>
<html>
<head>
<title>TOTAL</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
    background-image: url(ieslapineda.jpg);
}
-->
</style></head>
<body>
<form method="GET">
  <p>AUTOR:
    <?
    
//Creamos la sentencia SQL y la ejecutamos
    
$sele="select distinct(AUTOR) from libros order by AUTOR";
    
$result1=mysql_db_query("biblioteca",$sele);
    echo
'<select name="autor">';
    echo
'<option></option>';
    
//Generamos el menu desplegable
    
while ($row=mysql_fetch_array($result1))
    {
        echo 
'<option>'.$row["AUTOR"];
        echo 
'</option>';
    }
?></select>
    </p>
  <p>TITOL:
    <?
    
//Creamos la sentencia SQL y la ejecutamos
    
$sele="select distinct(TITOL) from libros order by TITOL";
    
$result2=mysql_db_query("biblioteca",$sele);
    echo
'<select name="TITOL">';
    echo
'<option></option>';
    
//Generamos el menu desplegable
    
while ($row=mysql_fetch_array($result2))
    {
        echo 
'<option>'.$row["TITOL"];
        echo 
'</option>';
    }
?></select>
    </p>
  <p>ID: 
    <?
    
//Creamos la sentencia SQL y la ejecutamos
    
$sele="select distinct(ID) from libros order by ID";
    
$result3=mysql_db_query("biblioteca",$sele);
    echo
'<select name="ID">';
    echo
'<option></option>';
    
//Generamos el menu desplegable
    
while ($row=mysql_fetch_array($result3))
    {
        echo 
'<option>'.$row["ID"];
        echo 
'</option>';
    }
?></select>
    </p>
  <p>MATERIES:
    <?
    
//Creamos la sentencia SQL y la ejecutamos
    
$sele="select distinct(MATERIES) from libros order by MATERIES";
    
$result4=mysql_db_query("biblioteca",$sele);
    echo
'<select name="MATERIES">';
    echo
'<option></option>';
    
//Generamos el menu desplegable
    
while ($row=mysql_fetch_array($result4))
    {
        echo 
'<option>'.$row["MATERIES"];
        echo 
'</option>';
    }
?></select>
    </p>
  <p>URL:
    <?
    
//Creamos la sentencia SQL y la ejecutamos
    
$sele="select distinct(URL) from libros order by URL";
    
$result5=mysql_db_query("biblioteca",$sele);
    echo
'<select name="URL">';
    echo
'<option></option>';
    
//Generamos el menu desplegable
    
while ($row=mysql_fetch_array($result5))
    {
        echo 
'<option>'.$row["URL"];
        echo 
'</option>';
    }
?></select>
    <input type="submit" name="boton" value="CONSULTAR">
  </p>
  </form>
<?
    $autor
=$_GET['autor'];
    
$titol=$_GET['TITOL'];
    
$ID=$_GET['ID'];
    
$MATERIES=$_GET['MATERIES'];
    
$URL=$_GET['URL'];
    
    
$result=mysql_query("select AUTOR,TITOL,ID,MATERIES,URL from libros 
    where AUTOR='"
.$autor."' 
    OR TITOL='"
.$TITOL."' 
    OR ID='"
.$ID."' 
    OR MATERIES='"
.$MATERIES."' 
    OR URL='"
.$URL."'",$link);
?>

<CENTER><table border=1 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD>&nbsp;<B>AUTOR</B></TD>
<TD>&nbsp;<B>TITOL</B></TD>
<TD>&nbsp;<B>ID</B></TD>
<TD>&nbsp;<B>MATERIES</B></TD>
<TD>&nbsp;<B>URL</B></TD>
</TR></CENTER>

<?PHP

    
while($row mysql_fetch_array($result)) 
       {    
          
printf("<tr>
          <td>&nbsp;%s</td>
          <td>&nbsp;%s</td>
          <td>&nbsp;%s</td>
          <td>&nbsp;%s</td>
          <td>&nbsp;%s</td>
          </tr>"
,
          
$row["AUTOR"],$row["TITOL"],$row["ID"],$row["MATERIES"],$row["URL"]);
       } 
     
    
mysql_free_result($result);
    
mysql_close($link);
?>
</TABLE>
</body>
</HTML>