Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/01/2012, 06:16
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: problema registro,lista en php

Veamos,

El "Listado de categorias", que se te va "al lao" y "no abajo"

Tienes este código:
Código PHP:
<h2>Lista de categor&iacute;as    </h2>
    <table width="100%" border="0" align="center" cellpadding="6" cellspacing="6">
      <tr>
        <td width="48%" bgcolor="#FFFFFF">Nombre de la categoria</td>
        <td width="52%" bgcolor="#FFFFFF">Acciones</td>
      </tr>
      <tr>
        <?php do { ?>
          <td><?php echo $row_category['description']; ?></td>
          <td>Editar - Eliminar</td>
          <?php } while ($row_category mysql_fetch_assoc($category)); ?>
      </tr>
    </table>
Si te fijas, estás haciendo "dos celdas" por cada categoria... sin cambiar el "row" (fila). Deberías tener algo así
Código PHP:
<h2>Lista de categor&iacute;as    </h2>
    <table width="100%" border="0" align="center" cellpadding="6" cellspacing="6">
      <tr>
        <td width="48%" bgcolor="#FFFFFF">Nombre de la categoria</td>
        <td width="52%" bgcolor="#FFFFFF">Acciones</td>
      </tr>
      
        <?php do { ?>
          <tr><td><?php echo $row_category['description']; ?></td>
          <td>Editar - Eliminar</td></tr>
          <?php } while ($row_category mysql_fetch_assoc($category)); ?>
      
    </table>
Que, básicamente, lo que he hecho ha sido cambiar el <tr> y </tr>, para ponerlos dentro del do ... while.
__________________
>> Eleazan's Source
>> @Eleazan