Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/09/2011, 03:15
rtduran70
 
Fecha de Ingreso: septiembre-2011
Mensajes: 2
Antigüedad: 12 años, 7 meses
Puntos: 0
Listado de productos en columnas

hola soy roberto:

estoy empezando con esto del PHP y tengo que preparar una pagina en la q se listen productos en 5 columnas, yo solo lo consigo con 1

adjunto codigo completo:

por favor necesito ayuda,,,,,,,,,,,,,,,,gracias

Código PHP:
<?php require_once('Connections/carrito.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$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;
}
}

$currentPage $_SERVER["PHP_SELF"];

$maxRows_listado 5;
$pageNum_listado 0;
if (isset(
$_GET['pageNum_listado'])) {
  
$pageNum_listado $_GET['pageNum_listado'];
}
$startRow_listado $pageNum_listado $maxRows_listado;

mysql_select_db($database_carrito$carrito);
$query_listado "SELECT * FROM zapatos";
$query_limit_listado sprintf("%s LIMIT %d, %d"$query_listado$startRow_listado$maxRows_listado);
$listado mysql_query($query_limit_listado$carrito) or die(mysql_error());
$row_listado mysql_fetch_assoc($listado);

if (isset(
$_GET['totalRows_listado'])) {
  
$totalRows_listado $_GET['totalRows_listado'];
} else {
  
$all_listado mysql_query($query_listado);
  
$totalRows_listado mysql_num_rows($all_listado);
}
$totalPages_listado ceil($totalRows_listado/$maxRows_listado)-1;

$queryString_listado "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_listado") == false && 
        
stristr($param"totalRows_listado") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_listado "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_listado sprintf("&totalRows_listado=%d%s"$totalRows_listado$queryString_listado);
?>
<!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" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Documento sin título</title>
<!-- TemplateEndEditable -->
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
.carrito {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #000;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
</style>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<table width="990" border="0">
  <tr>
    <td colspan="3"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1024" height="140">
      <param name="movie" value="banner1.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- Esta etiqueta param indica a los usuarios de Flash Player 6.0 r65 o posterior que descarguen la versión más reciente de Flash Player. Elimínela si no desea que los usuarios vean el mensaje. -->
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- La siguiente etiqueta object es para navegadores distintos de IE. Ocúltela a IE mediante IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="banner1.swf" width="1024" height="140">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="Scripts/expressInstall.swf" />
        <!-- El navegador muestra el siguiente contenido alternativo para usuarios con Flash Player 6.0 o versiones anteriores. -->
        <div>
          <h4>El contenido de esta página requiere una versión más reciente de Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Obtener Adobe Flash Player" width="112" height="33" /></a></p>
          </div>
        <!--[if !IE]>-->
        </object>
      <!--<![endif]-->
    </object></td>
  </tr>
  <tr>
    <td colspan="3"><object id="FlashID2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1025" height="50">
      <param name="movie" value="banner2.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="8.0.35.0" />
      <!-- Esta etiqueta param indica a los usuarios de Flash Player 6.0 r65 o posterior que descarguen la versión más reciente de Flash Player. Elimínela si no desea que los usuarios vean el mensaje. -->
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- La siguiente etiqueta object es para navegadores distintos de IE. Ocúltela a IE mediante IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="banner2.swf" width="1025" height="50">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="8.0.35.0" />
        <param name="expressinstall" value="Scripts/expressInstall.swf" />
        <!-- El navegador muestra el siguiente contenido alternativo para usuarios con Flash Player 6.0 o versiones anteriores. -->
        <div>
          <h4>El contenido de esta página requiere una versión más reciente de Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Obtener Adobe Flash Player" width="112" height="33" /></a></p>
          </div>
        <!--[if !IE]>-->
        </object>
      <!--<![endif]-->
    </object></td>
  </tr>
  <tr>
    <td width="330" height="39" align="center" bgcolor="#FFCC66" class="carrito">INICIO</td>
    <td width="330" align="center" bgcolor="#FFCC66"><p class="carrito">IR AL CARRO DE LA COMPRA</p></td>
    <td width="330" align="center" bgcolor="#FFCC66" class="carrito">CONTACTO</td>
  </tr>
  <tr>
    <td colspan="3" align="center"><!-- TemplateBeginEditable name="contenido" -->
      <p class="carrito">Listado de Productos</p>

      <?php do { ?>
        <table width="990" border="0">           
               <tr>

               <td align="center"><p><a href="detalle.php?NOMBREFOTOGRANDE=<?php echo $row_listado['NOMBREFOTOGRANDE']; ?>"><img src="fotoszapatospeques/<?php echo $row_listado['NOMBREFOTOPEQUE']; ?>" width="182" height="137" /></a></p>
              <p><?php echo $row_listado['REFERENCIA']; ?></p>
              <p><?php echo $row_listado['PRECIO']; ?> €</p></td>
              
          </tr>
             </table>       
                <?php } while ($row_listado mysql_fetch_assoc($listado)); ?>
   
         <p>
        <table border="0" align="center">
          <tr class="carrito">
            <td width="247" align="center" bgcolor="#FFCC66"><?php if ($pageNum_listado 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_listado=%d%s"$currentPage0$queryString_listado); ?>">Primera</a>
                <?php // Show if not first page ?></td>
          <td width="248" align="center" bgcolor="#FFCC66"><?php if ($pageNum_listado 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_listado=%d%s"$currentPagemax(0$pageNum_listado 1), $queryString_listado); ?>">Anterior</a>
                <?php // Show if not first page ?></td>
          <td width="248" align="center" bgcolor="#FFCC66"><?php if ($pageNum_listado $totalPages_listado) { // Show if not last page ?>
                <a href="<?php printf("%s?pageNum_listado=%d%s"$currentPagemin($totalPages_listado$pageNum_listado 1), $queryString_listado); ?>">Siguiente</a>
                <?php // Show if not last page ?></td>
          <td width="247" align="center" bgcolor="#FFCC66"><?php if ($pageNum_listado $totalPages_listado) { // Show if not last page ?>
                <a href="<?php printf("%s?pageNum_listado=%d%s"$currentPage$totalPages_listado$queryString_listado); ?>">&Uacute;ltima</a>
                <?php // Show if not last page ?></td>
          </tr>
        </table>
</p>
<p>&nbsp;</p>
    <!-- TemplateEndEditable --></td>
  </tr>
</table>
<script type="text/javascript">
swfobject.registerObject("FlashID");
swfobject.registerObject("FlashID2");
</script>
</body>
</html>
<?php
mysql_free_result
($listado);
?>