Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/01/2010, 19:00
kirst
 
Fecha de Ingreso: septiembre-2009
Mensajes: 230
Antigüedad: 14 años, 7 meses
Puntos: 2
[Ayuda] Listado vertical y no horizontal

Tengo un php, con 2 artículos, resulta que me tira los 2 artículos como si fuera una columna, en vez de una fila. Yo quiero listar así:

x x x
x x x


y no así:


x
x
x
x
x
x


se entiende? A ver, acá el PHP:

Código PHP:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?

// iniciamos session
session_start ();

// archivos necesarios
//require_once 'admin/config.php';
require 'm/delivery/admin/conexion.php';
require_once 
'm/delivery/admin/esUsuario.php';

// obtengo puntero de conexion con la db
//$dbConn = conectar();

// vemos si el usuario quiere desloguar
if ( !empty($_GET['salir']) ) {
    
// borramos y destruimos todo tipo de sesion del usuario
    
session_unset();
    
session_destroy();
    
header'Location: index.php' );
}

// listado de articulo
// traemos listado de articulo
if (!empty($_GET['idCategoria']) or  $_GET['idCategoria']=='1')
    {
$arrarticulo = array();
$query "SELECT * FROM `articulos` WHERE idCategoria = ".$_GET['idCategoria']." ORDER BY fPublicacion DESC";
$resultado mysql_query ($query$dbConn);
while ( 
$row mysql_fetch_assoc ($resultado))
{
    
array_push$arrarticulo,$row );
}
    }
elseif (!isset(
$_GET['cat']))
    {
$arrarticulo = array();
$query "SELECT * FROM `categorias` ORDER BY idCategoria DESC";
$resultado mysql_query ($query$dbConn);
while ( 
$row mysql_fetch_assoc ($resultado))
{
    
array_push$arrarticulo,$row );
}
    }


?>

    
    <? if ( !empty($_GET['registro']) ) { ?>
    <div style="background-color: #fdfdfd;border:1px solid #CC3183;width:90%;padding:5px">El registro ha sido exitoso.</div>
    <br  />
    <? ?>

    <?
    
if (!empty($_GET['idCategoria'])) {
    foreach ( 
$arrarticulo as $articulo ) { 
    
    echo 
'<table width="142" border="0" cellspacing="10" cellpadding="0" class="tbl1">
      <tr>
        <td align="center"><b>'
.$articulo[titulo].'</b></td>
      </tr>
      <tr>
        <td><table border="0" align="center" cellpadding="0" cellspacing="0" class="tabla_thumb">
          <tr>
            <td><a href="img/articulos/'
.$articulo[imagen].'" rel="lightbox[plants]" title="'.$articulo[titulo].'"><img src="img/articulos/'.$articulo[preimagen].'" alt="" width="122" height="91" border="0" /></a></td>
          </tr>
          </table></td>
      </tr>
      <tr>
        <td>$'
.$articulo[precio].'</td>
      </tr>
      <tr>
        <td align="center"><a href="articulos.php?m=verarticulo&idArticulo='
.$articulo[idArticulo].'"><img src="img/masinformacion.png" alt="" width="72" height="27" border="0" /></a></td>
      </tr>
    </table>
    
    
    <br  />
'
;
    }
    } 
?>
    
    <?    if (!isset($_GET['idCategoria'])) { ?>   
    <?    foreach ( $arrarticulo as $articulo ) {
    echo 
'<table width="142" border="0" cellspacing="10" cellpadding="0" class="tbl1">
      <tr>
        <td align="center"><b>'
.$articulo[valor].'</b></td>
      </tr>
      <tr>
        <td><table border="0" align="center" cellpadding="0" cellspacing="0" class="tabla_thumb">
          <tr>
            <td><a href="img/articulos/categorias/'
.$articulo[imagen].'" rel="lightbox[plants]" title="'.$articulo[titulo].'"><img src="img/articulos/categorias/'.$articulo[imagen].'" alt="" width="122" height="91" border="0" /></a></td>
          </tr>
          </table></td>
      </tr>
      <tr>
        <td align="center"><a href="articulos.php?m=index&idCategoria='
.$articulo[idCategoria].'"><img src="img/masinformacion.png" alt="" width="72" height="27" border="0" /></a></td>
      </tr>
    </table>
    
    <br  />
'
;
    }
    }
?>
Saludos.