Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/05/2010, 15:41
vili86
 
Fecha de Ingreso: septiembre-2009
Mensajes: 281
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Mostrando noticias php

Graicas Adler pero no entiendo bien por favor podrias ser un poco mas explicito hice esto
http://img576.imageshack.us/img576/102/noticiasq.png

Y puse DISTINCT A MI CONSULTa pensado que eso me lo iba a solucionar pero nno es asi me sigue repitiendo en en misma fila la misma notcia ??
Código PHP:
Ver original
  1. $categoria = $_GET['categoria'];
  2. $listado = mysql_query("select DISTINCT * from noticia where categoria='$categoria' and estado=1 order by id desc LIMIT 1");
  3. $nfilas = mysql_num_rows ($listado);
  4.  
  5. $result=mysql_query("Select * From noticia WHERE id='$id' LIMIT 1");
  6. $row=mysql_fetch_array($result);
  7.  
  8.       if ($nfilas > 0)
  9.       {
  10.  
  11. ?>
  12. <style type="text/css">
  13. <!--
  14. .Estilo1 {color: #FF0000}
  15. -->
  16. </style>
  17.  <?php     
  18.            while($row = mysql_fetch_array($listado)){
  19. ?>
  20.  
  21.   <table align="center" width="700" height="500" >
  22.     <tr><td>
  23.                <table>
  24.                 <tr>
  25.                 <td colspan="0" align="center"><h2><span class="Estilo1"><?php echo $row['titulo']; ?></span></h2></td>
  26.                 </tr>
  27.                 <tr>
  28.                 <td >
  29.  
  30. <?php
  31.          }
  32.         ?>
  33.            
  34.            
  35.         <?php  
  36.      
  37.         mysql_free_result($listado);
  38.          }
  39.       else
  40.       echo (" <center> No existen noticias Publicadas... </center>");
  41.       mysql_close($link);
  42.  
  43.  
  44.  
  45. ?>
  46.  
  47. </table>

Resumi en codigo para no extenderlo mucho No se que puedo estar haciendo mal en mi consulta ? o es en mis condiciones ?