
30/11/2006, 03:15
|
 | | | Fecha de Ingreso: septiembre-2006
Mensajes: 295
Antigüedad: 18 años, 6 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> </p>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR align="center"><TD width="109"><strong> Título</strong></TD>
<TD width="140"><strong> Categoría </strong></TD>
<TD width="112"><strong> Comentario</strong></TD>
<TD width="112"><strong> Imagen</strong></TD>
</TR>
<?php
while($row = mysql_fetch_array($result)) {
printf("<tr align='center'><td> %s</td><td> %s </td><td> %s </td><td> <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 |