🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #7689

poner (distribuir) resutados en celdas (3 colunas y x filas, segun el numero de resultados). Me podeis ayudar

#7689
From: [ZoRo]
Date: Fri, 07 Feb 2003 10:59
47 lines
2185 bytes
Hola tengo un scrip que os lo pongo abajo con el que saco resultados de una
tabla, bien hasta aqui para mi facil peo lo que queiro es tener tres
columnas e ir distribuyendo los resultados por las columnas para ir llenado
filas de esta menra:
<table>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
<tr><td>7</td><td></td><td></td></tr>
</table>

Para ello tengo esto pero no me anda:

<table width="100%" border="0" align="center" cellpadding="2">
<%
$ii = 1;
$i=0;
mysql_select_db ("basededatos", $connection_id);
$result = mysql_query ("select * from fotos");
while ($row = mysql_fetch_assoc ($result))
{
 if (i%3==0){
if (ii==0){echo("<tr>");}
%>
 <td valign="top">
  <table width="100%" border="0" cellspacing="2" cellpadding="0">
 <tr>
<td valign="top">
<div align="center"><img src="/images/<?=$row[imagen]?>" border="2"
alt=""></div><?php echo($ii);?></td>
</tr>
<tr>
 <td class="date-stamp">
<div align="left"><span
class="textonormal"><?=$row[descripcion]?></span></td>
</tr>
 </table>
</td>
<%
if (ii%3==0){
echo("</tr>");
  }
i=0;
ii++;
    }
}
%>
</table>
Technical Details
Message-ID: <b203lh$17ok3l$1@ID-59646.news.dfncis.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!217-127-108-221.uc.nombres.ttd.ES!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit
X-Google-Thread: f86c8,e417ad3f3c791e2b,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-02-07 03:01:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!217-127-108-221.uc.nombres.ttd.ES!not-for-mail
From: "[ZoRo]" <granbilbao_NOSPAM_@latinmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: poner (distribuir) resutados en celdas (3 colunas y x filas, segun el numero de resultados). Me podeis ayudar
Date: Fri, 7 Feb 2003 11:59:03 +0100
Lines: 49
Message-ID: <b203lh$17ok3l$1@ID-59646.news.dfncis.de>
NNTP-Posting-Host: 217-127-108-221.uc.nombres.ttd.es (217.127.108.221)
X-Trace: fu-berlin.de 1044615666 41701493 217.127.108.221 (16 [59646])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106