Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/12/2010, 09:56
edaf88
 
Fecha de Ingreso: noviembre-2010
Ubicación: Puerto Montt
Mensajes: 27
Antigüedad: 14 años, 3 meses
Puntos: 0
Respuesta: imprimir registro en horizontal

ya lo resolvi, por si a alguien le interesa:

<?php

include ("conex/conexion2.php");
conex_usu();


$listarmenu = mssql_query("select DISTINCT codigo_menu,nombre_menu

from www_menu

left join www_control on
codigo_menu = menu_control

where codigo_control = 'mrios'
ORDER BY codigo_menu",$conex_usu);

$num_rows = mssql_num_rows($listarmenu);
$columns = $num_rows;

if ($num_rows > 0)
{
echo "<br>"."<table align=center border=0>\n";
for($i = 0; $i < $num_rows; $i++)
{
$row = mssql_fetch_array($listarmenu);

if($i % $columns == 0)
{
//SI NO HAY RESTO SIGNIFICA QUE INICIAMOS UNA NUEVA FILA
echo "<tr>\n";
}

$imgmenu = $row["nombre_menu"];
echo "<TD><img src=imagenes/".$imgmenu.".png height=26/></TD>\n";

if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows)
{
//SI EL RESTO ES UNO
//O SI NO HAY NADA MAS A LA IZQUIERDA
//ES EL FINAL DE LA TABLA
echo "</tr>\n";
}
}
echo "</table>\n";
}


?>