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

Hola amigos mi problema pasa por los siguiente quiero mostrar mis noticias en una tabla de 2 X 2 logre que me mostrara pero de una manera muy rara Me las muestra repitiendo la misma noticias 2 veces en una misma fila ????

http://img190.imageshack.us/img190/7461/noticiasjn.png

Este es mi codigo.
Código PHP:
Ver original
  1. <?php  
  2. include('conectar.php');
  3. $link=Conectarse();
  4. $categoria = $_GET['categoria'];
  5. $listado = mysql_query("select * from noticia where categoria='$categoria' and estado=1 order by id desc LIMIT 1");
  6.  $nfilas = mysql_num_rows ($listado);
  7.  
  8. $result=mysql_query("Select * From noticia WHERE id='$id' LIMIT 1");
  9. $row=mysql_fetch_array($result);
  10.  
  11.       if ($nfilas > 0)
  12.       {
  13.  
  14. ?>
  15. <style type="text/css">
  16. <!--
  17. .Estilo1 {color: #FF0000}
  18. -->
  19. </style>
  20.  <?php     
  21.            while($row = mysql_fetch_array($listado)){
  22. ?>
  23.  
  24.   <table align="center">
  25.     <tr><td>
  26.                <table  border="0" align="center">
  27.                     <tr>
  28.                     <td colspan="0" align="center"><h2><span class="Estilo1"><?php echo $row['titulo']; ?></span></h2>
  29.                        
  30.                      
  31.                         <?php
  32.                        
  33.                              if (empty($row['foto'])){
  34.                              ?>
  35.                               <img align= "absmiddle" border="0" style=" margin-right:10px; float:left;" src="modulos/noticias/vistas/fotos/defecto.jpg" width="80" height="80" align="left">  
  36.                              
  37.                               <?php
  38.                               } else{
  39.                             ?>
  40.                              <img  align="absmiddle" border="0" style=" margin-right:10px; float:left;" src="modulos/noticias/vistas/fotos/<? echo strip_tags($row['foto']) ?>" width="80" height="80" align="left">
  41.                             <?php }?>
  42.                            
  43.                        
  44.                         <div align="justify"><?php echo $row['texto_corto']; ?> </div></td>
  45.                         <?php echo $row['fecha_publicacion']; ?> <a href="index.php?mod=noticias&pag=leer_noticia&id=<?php echo $row['id']; ?> ">Leer más..</a></td>
  46.                                   </tr>
  47.                        
  48.                                   </table>
  49.                                  
  50.         </td>
  51.         <td>
  52.        
  53.        
  54.                                   <table  border="0" align="center">
  55.                     <tr>
  56.                     <td colspan="0" align="center"><h2><span class="Estilo1"><?php echo $row['titulo']; ?></span></h2>
  57.                        
  58.                      
  59.                         <?php
  60.                        
  61.                              if (empty($row['foto'])){
  62.                              ?>
  63.                               <img align= "absmiddle" border="0" style=" margin-right:10px; float:left;" src="modulos/noticias/vistas/fotos/defecto.jpg" width="80" height="80" align="left">  
  64.                              
  65.                               <?php
  66.                               } else{
  67.                             ?>
  68.                              <img  align="absmiddle" border="0" style=" margin-right:10px; float:left;" src="modulos/noticias/vistas/fotos/<? echo strip_tags($row['foto']) ?>" width="80" height="80" align="left">
  69.                             <?php }?>
  70.                            
  71.                        
  72.                         <div align="justify"><?php echo $row['texto_corto']; ?> </div></td>
  73.                         <?php echo $row['fecha_publicacion']; ?> <a href="index.php?mod=noticias&pag=leer_noticia&id=<?php echo $row['id']; ?> ">Leer más..</a></td>
  74.                                   </tr>
  75.                        
  76.                                   </table>
  77. <?php
  78.          }
  79.         ?>
  80.            
  81.            
  82.         <?php  
  83.      
  84.         mysql_free_result($listado);
  85.          }
  86.       else
  87.       echo (" <center> No existen noticias Publicadas... </center>");
  88.       mysql_close($link);
  89.  
  90.  
  91.  
  92. ?>
  93.  
  94. </table>
Espero me pueda ayudar Gracias