Foros del Web » Programando para Internet » PHP »

Problema al ordenar las tablas

Estas en el tema de Problema al ordenar las tablas en el foro de PHP en Foros del Web. Bien pues espero ser claro con mi pregunta y espero alguien me pueda echar una manita... Bien ya casi termino de dasarrollar una Base de ...
  #1 (permalink)  
Antiguo 01/05/2008, 21:38
Avatar de Capimaster  
Fecha de Ingreso: agosto-2004
Mensajes: 494
Antigüedad: 19 años, 8 meses
Puntos: 2
Problema al ordenar las tablas

Bien pues espero ser claro con mi pregunta y espero alguien me pueda echar una manita...

Bien ya casi termino de dasarrollar una Base de datos que me facilitara mucho el trabajo

Código PHP:
<?php require_once('../Connections/portadas.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$maxRows_mostrar 18;
$pageNum_mostrar 0;
if (isset(
$_GET['pageNum_mostrar'])) {
  
$pageNum_mostrar $_GET['pageNum_mostrar'];
}
$startRow_mostrar $pageNum_mostrar $maxRows_mostrar;

mysql_select_db($database_portadas$portadas);
$query_mostrar "SELECT * FROM portadas ORDER BY id DESC";
$query_limit_mostrar sprintf("%s LIMIT %d, %d"$query_mostrar$startRow_mostrar$maxRows_mostrar);
$mostrar mysql_query($query_limit_mostrar$portadas) or die(mysql_error());
$row_mostrar mysql_fetch_assoc($mostrar);

if (isset(
$_GET['totalRows_mostrar'])) {
  
$totalRows_mostrar $_GET['totalRows_mostrar'];
} else {
  
$all_mostrar mysql_query($query_mostrar);
  
$totalRows_mostrar mysql_num_rows($all_mostrar);
}
$totalPages_mostrar ceil($totalRows_mostrar/$maxRows_mostrar)-1;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
body,td,th {
    font-family: Segoe UI, Arial, Times New Roman;
    font-size: 11px;
}
-->
</style></head>

<body>
<table border="0" cellpadding="0" cellspacing="1">
  <?php do { ?>
    <tr>
      <td><table width="205" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td background="/eventos/<?php echo $row_mostrar['galeria']; ?>/thumbnails/<?php echo $row_mostrar['archivo']; ?>"><a href="/eventos/<?php echo $row_mostrar['galeria']; ?>/index.html" target="_blank"><img src="/TOP/gallery/top.gif" width="214" height="178" border="0" /></a></td>
        </tr>
        <tr>
          <td height="109" background="/TOP/gallery/foot.jpg"><table width="96%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="center"><strong><?php echo $row_mostrar['titulo']; ?></strong></div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['fecha']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['lugar']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center">Fotos por: <?php echo $row_mostrar['fotos']; ?></div></td>
              </tr>
            </table>
              <p align="center">&nbsp;</p></td>
        </tr>
      </table></td>
      <td><table width="205" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td background="/eventos/<?php echo $row_mostrar['galeria']; ?>/thumbnails/<?php echo $row_mostrar['archivo']; ?>"><a href="/eventos/<?php echo $row_mostrar['galeria']; ?>/index.html" target="_blank"><img src="/TOP/gallery/top.gif" width="214" height="178" border="0" /></a></td>
        </tr>
        <tr>
          <td height="109" background="/TOP/gallery/foot.jpg"><table width="96%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="center"><strong><?php echo $row_mostrar['titulo']; ?></strong></div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['fecha']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['lugar']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center">Fotos por: <?php echo $row_mostrar['fotos']; ?></div></td>
              </tr>
            </table>
              <p align="center">&nbsp;</p></td>
        </tr>
      </table></td>
      <td><table width="205" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td background="/eventos/<?php echo $row_mostrar['galeria']; ?>/thumbnails/<?php echo $row_mostrar['archivo']; ?>"><a href="/eventos/<?php echo $row_mostrar['galeria']; ?>/index.html" target="_blank"><img src="/TOP/gallery/top.gif" width="214" height="178" border="0" /></a></td>
        </tr>
        <tr>
          <td height="109" background="/TOP/gallery/foot.jpg"><table width="96%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="center"><strong><?php echo $row_mostrar['titulo']; ?></strong></div></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['fecha']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center"><?php echo $row_mostrar['lugar']; ?></div></td>
              </tr>
              <tr>
                <td><div align="center">Fotos por: <?php echo $row_mostrar['fotos']; ?></div></td>
              </tr>
            </table>
              <p align="center">&nbsp;</p></td>
        </tr>
      </table></td>
    </tr>
    <?php } while ($row_mostrar mysql_fetch_assoc($mostrar)); ?>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result
($mostrar);
?>
este es el link para que vean...

http://www.elcapitolio.net/eventos/mostrar.php

El problema es que yo quiero que me acomode las tablas en 3 columnas pero creo que no se nada acerca de como hacerlo por que me repite la misma galeria en las 3 columnas y las muestr pero para abajo..

ojala me puedan ayudar

Les muestro cual quisiera que fuera el resultado ya terminando mi Base de datos

http://www.elcapitolio.net/eventos/
Muchas Gracias
__________________
http://www.elcapitolio.com.mx - Ocotlán, Jalisco, México
  #2 (permalink)  
Antiguo 01/05/2008, 23:36
Avatar de .php  
Fecha de Ingreso: julio-2006
Mensajes: 481
Antigüedad: 17 años, 8 meses
Puntos: 5
Re: Problema al ordenar las tablas

estaba viendo tu fuente y no estoy acostumbrado al html con el php, pero lo que veo es problema de disiño o manejo de tablas.
cuando termines tu loop (do) no debes cerrar la tabla y lo otro para que no se repitan tus imagenes o los mismos datos debes ocupar el criterio distinct

select disctinct imagenes from portadas ORDER BY id DESC

lo lamento por no ayudar con codigo, pero la teoría = es buena.


suerte
__________________
~~[FiDeLio]~~
  #3 (permalink)  
Antiguo 02/05/2008, 00:28
Avatar de Capimaster  
Fecha de Ingreso: agosto-2004
Mensajes: 494
Antigüedad: 19 años, 8 meses
Puntos: 2
Re: Problema al ordenar las tablas

Hasta ahora he logrado hacer algo, ya pude hacer que las tablas se repitan hacia a la dereche en vez de para abajo. el problema es que se repite infinitamente hacia la derecha y lo que yo necesito son solo 3 columnas y varias filas hacia abajo... alguien sabe si puedo limitar a que solo se reproduscan 3 columnas y de ahi en adelanta filas hacia abajo...
__________________
http://www.elcapitolio.com.mx - Ocotlán, Jalisco, México
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:26.