Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/07/2003, 19:28
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 5 meses
Puntos: 1
Ayuda con error

Hola:
Tengo el siguiente código para paginar los resultados sacados de una BD:
Código PHP:
<?
$coneccion 
mysql_connect("localhost","","") || die ("Error");
mysql_select_db("mybd");
IF (
$num>0
 {
   
$n=$num;} ELSE { $n=0
 }
 
$conta="SELECT id FROM db ";
 
$result2 mysql_query($conta); 
 
$quants mysql_num_rows($result2);
 
$sql="SELECT * FROM db ORDER BY id DESC LIMIT ".$n.", 15 ";
 
$result=mysql_query($sql,$conexio);
if (
$row mysql_fetch_array($result))
 {
  echo 
"<TABLE BORDER='0'>";
   DO
    { 
     echo 
"<TR><TD> ".$row["documento"]."</TD> </TR>";
    }
  WHILE (
$row=mysql_fetch_array($result));
  echo 
"</TABLE>";
 } 
echo 
"<HR><TABLE BORDER='0' ALIGN='center' WIDTH='95%'><TR>";
echo 
"<TD ALIGN='left'> Encontrados ".$quants." artículos </TD>";
echo
"<TD ALIGN='RIGHT'>";
echo 
"<FONT FACE='Arial' SIZE='-1' COLOR='#336699'>Páginas: </FONT>";
FOR (
$i=0$i$quants$i=$i+15)
 {
  
$a=$a+1//Incrementamos el número de página
   
IF ($n==$i
    {
      echo 
"<A HREF='doc.php?num=".$i."'>[<B>".$a."< /B>]   </A> ";
    }
   ELSE
   {
     echo 
"<A HREF='doc.php?num=".$i."'>' [".$a."] </A> ";
   }
 }
  echo 
"</TD></TR></TABLE>"
 
mysql_close(); 
?>
y me da estos errores:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in c:\program files\apache group\apache\htdocs\pagina.php on line 18

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\pagina.php on line 20

¿Qué hago mal?
__________________
Ing. Reynier Pérez Mira