Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/12/2006, 11:52
pakillo
 
Fecha de Ingreso: mayo-2004
Mensajes: 400
Antigüedad: 20 años
Puntos: 0
como mostrar resultados por columnas?

Hola tengo un script al cual me gustaria cambiarle la forma de presentar los resultados, me gustaria que lo haga por columnas de esta forma

en lugar de esto
1
2
3
4
5

que sea asi

1 2 3
4 5 6
7 8 9

claro que los resultados que muestra no son numeros son varios datos id, nombre, etc,. Asi es como los muestra ahora

Código PHP:
if (($d == "") || ($d == 0)) {
        
$d 1;
}
$sqld $d 1;
$sqld *= $limit;
$result $db->sql_query("SELECT * FROM ".$prefix."_video_stream ".$sortby2." ".$sortby1." LIMIT $sqld,$limit");
$rowvid $db->sql_numrows($result);
$result2 $db->sql_query("SELECT * FROM ".$prefix."_video_stream ".$sortby2." ".$sortby1."");
$rowvid2 $db->sql_numrows($result2);

// If videos are in the DB then they are displayed.
if ($rowvid != "0") {

        while(
$row $db->sql_fetchrow$result )) {
                
$userav $row['user'];
                if (
$row['rating'] == "") {$rating "0";} else {$rating $row['rating'];}
                        
$id $row['id'];
                        echo 
"<table width=\"100%\"  border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td>";
                        
avatars($userav);
                        echo 
"</td><td width=\"100%\"><a href=\"modules.php?name=Video_Stream&amp;page=watch&amp;id=".$row['id']."&amp;d=".$d."\">".$row['vidname']."</a><br>";
                        echo 
"<strong><font size=\"2\">".$row['date']."</font></strong><br>".$row['user']." <a href=\"modules.php?name=Video_Stream&amp;page=search&amp;search=user:".$row['user']."\">["._MOREFROMUSER."]</a></td></tr></table>";
                        echo 
"<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td width=\"50%\" valign=\"top\"></td><td align=\"right\" valign=\"top\">";           
                        
category($id);
                        echo 
"</td></tr></table>";

                        echo 
"<table width=\"100%\"  border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td width=\"98%\">";

                        echo 
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr>";
                        
$image $row['imgurl'];

                if (
$image == "") {
                        echo 
"<td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"modules.php?name=Video_Stream&amp;page=watch&amp;id=".$row['id']."&amp;d=".$d."\"><img src=\"modules/Video_Stream/images/noimage.gif\" border=\"0\"  height=\"150\" alt=\"".$row['vidname']."\"></a></td></tr></table></td>";
                } else{
                        echo 
"<td><table border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"modules.php?name=Video_Stream&amp;page=watch&amp;id=".$row['id']."&amp;d=".$d."\"><img src=\"".$image."\" border=\"0\"  height=\"150\" alt=\"".$row['vidname']."\"></a></td></tr></table></td>";
                }
                echo 
"<td width=\"80%\" valign=\"top\"><b>"._DESCRIPTION." :</b> ".$row['description']."</td>";  // agregada por mi
                
echo "</tr></table>";

                echo 
"</td><td width=\"100%\" valign=\"top\">";
                echo 
"</td></tr></table><br><div align=\"center\">___________________________________________________________________________";
        }

        
$pages   ceil($rowvid2 $limit);

        echo 
"<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\">";

        if (
$d 1) {
                
$p $d 1;
                echo 
"<div align=\"left\"><a href=\"modules.php?name=Video_Stream&amp;d=".$p."\">"._PREVIOUS."</a></div>";
        } else {
                echo 
"&nbsp;";
        }

        echo 
"</td><td width=\"40%\"><div align=\"center\">";
        
pagesnav($d$pages);
        echo 
"<br>"._PAGE." ".$d."/".$pages."</div></tr><td width=\"30%\">";

        if (
$d $pages) {
                
$d += 1;
                echo 
"<div align=\"right\"><a href=\"modules.php?name=Video_Stream&amp;d=".$d."\">"._NEXT."</a></div>";
        } else {
                echo 
"&nbsp;";
        }


        echo 
"</td></tr></table>";


como veis ya pagina los resultados, solo quiero que me muestre los resultados en 2 o 3 columnas, como podria hacerlo?

Un saludo