Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2006, 03:15
Avatar de alllebor
alllebor
 
Fecha de Ingreso: septiembre-2006
Mensajes: 295
Antigüedad: 17 años, 7 meses
Puntos: 1
Ordenar Descendente por id

Pues eso me gustaria ordenar un listado que he hecho descendentemente por el campo "id" que es la clave primaria y autoincrementable, el problema que yo pongo en la consulta select * from peliculas ORDER BY id DSC, pero no funciona me da este error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/sites/1/iespana.es/a/l/alllebor/site/peli/consultar.php on line 25

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /www/sites/1/iespana.es/a/l/alllebor/site/peli/consultar.php on line 28


Aqui os pongo el codigo

<?php
include("conex.php");
$link=Conectarse();
$result=mysql_query("select * from peliculas ORDER BY id DSC",$link);
?>
</p>

<table border="1" bordercolor="#000000"> <tr><td> <a href="insertar.php">Administrador</a></td></tr></table>
<p>&nbsp;</p>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR align="center"><TD width="109"><strong>&nbsp;Título</strong></TD>
<TD width="140"><strong>&nbsp;Categoría&nbsp;</strong></TD>
<TD width="112"><strong>&nbsp;Comentario</strong></TD>
<TD width="112"><strong>&nbsp;Imagen</strong></TD>
</TR>
<?php

while($row = mysql_fetch_array($result)) {
printf("<tr align='center'><td>&nbsp;%s</td><td>&nbsp;%s&nbsp;</td><td>&nbsp;%s&nbsp;</td><td>&nbsp;<img src='%s' border='0' width='100' height='100' /></td></tr>", $row["titulo"],$row["categoria"], $row["comentario"], $row["imagen"]);
}
mysql_free_result($result);
mysql_close($link);
?>

Alguien tiene alguna solucion?? Se lo agradeceria mucho