Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/05/2008, 02:58
MadKat
 
Fecha de Ingreso: marzo-2008
Mensajes: 171
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: [problema & Ayuda] Ordenamiento

Gracias por la respuesta! aunque sinceramente no te entendi :(

El codigo por si sirve es:

Código PHP:
<?php

require_once('Connections/uf.php');

mysql_select_db($database_uf$uf);
$query_mostrar_noticias "SELECT * FROM noticias ORDER BY fecha DESC";
$mostrar_noticias mysql_query($query_mostrar_noticias$uf) or die(mysql_error());
$row_mostrar_noticias mysql_fetch_assoc($mostrar_noticias);
$totalRows_mostrar_noticias mysql_num_rows($mostrar_noticias);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>

</head>

<body bgproperties="fixed">
<table width="490" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right"><form id="form1" name="form1" method="post" action="">
      <label>
        <span class="Estilo8"><strong>Ordenar noticias por</strong>:</span>
        <select name="orden" id="orden">
          <option value="autor" selected="selected">Autor</option>
          <option value="fecha">Fecha</option>
          <option value="titulo">Titulo</option>
        </select>
        <input type="submit" name="Submit" value="Actualizar" />
        </label>
      </form></td>
  </tr>
</table>
<table width="490" height="145" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td width="664" height="143" valign="top"><?php do { ?>
      <?php if ($totalRows_mostrar_noticias 0) { // Show if recordset not empty ?>
          <table width="490" cellpadding="0" cellspacing="0">
          <tr>
            <td width="490"><span class="titulo1"><?php echo $row_mostrar_noticias['titulo']; ?></span>
                <table width="100%" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="imagenes/blank.gif" width="1" height="1" /></td>
                  </tr>
                </table>
              <span class="etiquetas1">Autor:</span> <span class="contenidos"><?php echo $row_mostrar_noticias['autor']; ?></span> <span class="etiquetas1">Fecha de publicaci&oacute;n:</span> <span class="contenidos"><?php echo $row_mostrar_noticias['fecha']; ?></span><br />
              <table width="485" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="imagenes/blank.gif" width="1" height="5" /></td>
                  </tr>
                  <tr>
                    <td><span class="resumen"><?php echo $row_mostrar_noticias['resumen']; ?></span></td>
                  </tr>
                  <tr>
                    <td align="right"><span class="Estilo6">Ver noticia completa <a href="/uf/pdf/noticia.php?id=<?php echo $row_mostrar_noticias['id']; ?>" target="_blank"><img src="imagenes/pdficon_small.gif" width="17" height="17" border="0" /></a></span></td>
                  </tr>
                  <tr>
                    <td height="8"><img src="file:///C|/SERVER/www/uf/imagenes/blank.gif" width="1" height="2" /></td>
                  </tr>
              </table></td>
          </tr>
        </table>
        <table width="150" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="1" bgcolor="#FFFFFF"><img src="file:///C|/SERVER/www/uf/imagenes/blank.gif" width="1" height="1" /></td>
          </tr>
        </table>
        <table width="490" cellspacing="0" cellpadding="0">
          <tr>
            <td height="3"><img src="imagenes/blank.gif" width="1" height="1" /></td>
          </tr>
        </table>
        <?php // Show if recordset not empty ?>
      <?php } while ($row_mostrar_noticias mysql_fetch_assoc($mostrar_noticias)); ?></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result
($mostrar_noticias);
?>
Gracias de nuevo!

Besos, Agus!