Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/07/2012, 01:42
javy
 
Fecha de Ingreso: septiembre-2002
Mensajes: 153
Antigüedad: 21 años, 7 meses
Puntos: 1
Como puedo pasar este código a DIV?

Hola a todos:

Soy Javy de nuevo.

Hasta hace poco usaba este código paa mostrar una serie de imágenes por filas y columnas:

Código:
<?php
     //CONECTANDO CON LA BASE DE DATOS
     require_once("incluye/config_invitado.php");
     require_once("incluye/funciones.php");
     //CONECTANDO A MYSQL
     $cnx = conectar();
     //CONSULTA
     $sql = "SELECT clientesempresasfoto, clientesempresastexto FROM clientesempresas ORDER BY clientesempresasid DESC";
     $res= mysql_query($sql) or die (mysql_error());
     $result = mysql_query($sql);
     $row = mysql_fetch_array($result);
			
     if ($row){//SI HAY RESULTADOS
?>
<table cellspacing="0" cellpadding="0" align="center" width="100%"><!-- COMIENZO TABLA IMAGENES DE CLIENTES -->
     <tr>
<?php
     $Maximo=6;//FOTOS POR FILA - COLUMNAS
     $Contador = 0;//REINICIA EL SISTEMA
     do {
     $texto = "".$row['clientesempresastexto']."";//SE CARGA EL TEXTO, INCLUYENDO LAS ETIQUETAS HTML
     $texto2 = strip_tags($texto);//LIMPIA LAS ETIQUETAS HTML DEL TEXTO
     echo "<td><a href='#\'><img src='".$row['clientesempresasfoto']."' alt='$texto2' title='$texto2'/></a>\n";//MOSTRARA LA IMAGEN Y UN TOOLTIP CON EL TEXTO
     echo "</td>\n";//ABRE FILA E IMPRIME LOS DATOS

     $Contador++;//SUMA UNO AL CONTADOR YA QUE IMPRIMIO UNA FILA
     if ($Contador == $Maximo) {//COMPARA SI LLEGO A LA CANTIDAD DE FILAS

     echo "</tr><tr>\n";//Y CIERRA COLUMNA PARA EMPEZAR DE NUEVO
     $Contador = 0;
     }
     } while ($row = mysql_fetch_array($result));
?>
     </tr> 
</table><!-- CIERRA LA TABLA IMAGENES DE CLIENTES Y EL PRIMER TR -->
<?php
     } else {
     echo "<table cellspacing='0' cellpadding='0'>\n";
     echo "<tr><td class='texto'><img src='imagenes/pagina/flecha.gif' hspace='5' align='absmiddle' />Página en Mantenimiento: disculpen las molestias.</td></tr>\n";
     echo "</table>\n";
     echo $result[0];
     }
     mysql_close($cnx);
?>
Quisiera poder usar el mismo código pero usando <DIV> en vez de <TABLE>... ¿me podrían ayudar?

He probado de mil maneras pero no soy capaz.

Gracias por su atención y ayuda, y un saludo a todos:

Javy