Ver Mensaje Individual
  #10 (permalink)  
Antiguo 15/06/2004, 06:08
Avatar de LeCLUB
LeCLUB
 
Fecha de Ingreso: abril-2003
Ubicación: Barcelona (España)
Mensajes: 205
Antigüedad: 22 años
Puntos: 1
Weeeeeno, a ver si así te queda algo más claro xDDDD


Código PHP:
 
<%
'Lo primero, Te conectas a la BBDD 
'
y haces la consulta SQL
 
'Miramos si hay registros en el resultado
If rs.BOF And rs.EOF Then
 
'
Si no hay registrosno mostramos nada
'Si hay registros, empezamos a pintar la tabla
'
y reiniciamos el contador
else
 
contador 1
 
'Creamos un Bucle que pinte la tabla principal,
'
siempre y cuando existan más registros que sacar
While Not rs.EOF
%>
 
<
table width="400" border="0" cellspacing="0" cellpadding="0">
  <
tr>
   <
td width="100">
        <% 
        
'Si hay un registro que mostrar, pintamos la tabla
        '
interior con el contenido de los RecordSet y el contador
        
if NOT Rs.EOF 
        
%>
        <
table width="100" border="0" cellpadding="0" cellspacing="0">
        <
tr>
        <
td>ESTO ES LA TABLA 1</td>
        </
tr>
        </
table>
        <%
        
'Incrementamos el contador y saltamos a un nuevo registro
        contador = contador + 1
        Rs.Movenext()
        End if
        %>
        </td>
   <td width="100">
        <% 
        '
Si hay un registro que mostrarpintamos la tabla
        
'interior con el contenido de los RecordSet y el contador
        if NOT Rs.EOF 
        %>
        <table width="100" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td>ESTO ES LA TABLA 2</td>
        </tr>
        </table>
        <%
        '
Incrementamos el contador y saltamos a un nuevo registro
        contador 
contador 1
        Rs
.Movenext()
        
End if
        %>
        </
td>
   <
td width="100">
        <% 
        
'Si hay un registro que mostrar, pintamos la tabla
        '
interior con el contenido de los RecordSet y el contador
        
if NOT Rs.EOF 
        
%>
        <
table width="100" border="0" cellpadding="0" cellspacing="0">
        <
tr>
        <
td>ESTO ES LA TABLA 3</td>
        </
tr>
        </
table>
        <%
        
'Incrementamos el contador y saltamos a un nuevo registro
        contador = contador + 1
        Rs.Movenext()
        End if
        %>
        </td>
   <td width="100">
        <% 
        '
Si hay un registro que mostrarpintamos la tabla
        
'interior con el contenido de los RecordSet y el contador
        if NOT Rs.EOF 
        %>
        <table width="100" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td>ESTO ES LA TABLA 4</td>
        </tr>
        </table>
        <%
        '
Incrementamos el contador y saltamos a un nuevo registro
        contador 
contador 1
        Rs
.Movenext()
        
End if
        %>
        </
td>
  </
tr>
</
table>
 
<%
'Volvemos a la parte superior del Bucle, o
'
terminamos el bucle de pintar la Tabla Principal
si ya no quedan más registros que mostrar
Wend
 
End 
if
%> 
Y ya está ! no hace falta pintar más tablas, ni nada de nada