Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/10/2010, 09:56
imorrison
 
Fecha de Ingreso: mayo-2010
Mensajes: 12
Antigüedad: 14 años
Puntos: 0
paginacion en php y mysql

tengo mi codigo de un carro de compras pero necesito paginar lo resultados de la base de datos porfavor adjunto el codigo para que me puedan ayudar

Código PHP:
<?php
ob_start
("ob_gzhandler");
//Las funciones ob_start y
//ob_end_flush te permiten
//escojer en qué momento
//enviar el resultado de un
//script al navegador. Si
//no las utilizamos estamos
//obligados a que nuestra
//primera línea de código
//sea session_start() u
//obtendremos un error
session_start();
//conectamos a la base de
//datos
mysql_connect("localhost","","");
mysql_select_db("");
//rescatamos los valores
//guardados en la variable de
//sesión (si es que hay alguno,
// cosa que comprobamos con isset)
//y los asignamos a $carro.
//Si no existen valores, ponemos a false
//el valor de $carro
if(isset($_SESSION['carro']))
$carro=$_SESSION['carro'];else $carro=false;
//y hacemos la consulta
$qry=mysql_query("select * from articulos where codfamilia = 5 and borrado=0  order by codarticulo asc");
?>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="application/xhtml+xml; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
#outer1 {float:left; width:400px; height:190px;  padding:10px; }
#outer3 {float:right; width:400px; height:190px; padding:10px; }
#wrapper1 {overflow:hidden; }
#footer {clear:both; }
</style>
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Cotizacion</title>
    
    <style type="text/css" media="all">
        @import url("css/style.css");
        @import url("css/jquery.wysiwyg.css");
        @import url("css/facebox.css");
        @import url("css/visualize.css");
        @import url("css/date_input.css");
    </style>
    
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=7" /><![endif]-->
    <!--[if lt IE 8]><style type="text/css" media="all">@import url("css/ie.css");</style><![endif]-->

    <!--[if IE]><script type="text/javascript" src="js/excanvas.js"></script><![endif]-->
    
     
</head>

<body onLoad="inicio()">
    
    <div id="hld">
    
      <div class="wrapper">        <!-- wrapper begins --><!-- #header ends -->
            
            
         <div class="block">
            
           <div class="block_head">
                    <div class="bheadl"></div>
              <div class="bheadr"></div>
                    
                <h2><span class="header">Catalogo Productos Cadenas</span></h2>
             
</div>        
                <!-- .block_head ends -->
                
                 <div id="wrapper1">
             
                     


             
                
                 
            
            <div id="footer">
            <table width="800" align="center"  cellpadding="0" cellspacing="0">
<tr>
<td width="170"><strong>Imagen</strong></td>
<td width="170"><strong><center>Producto</center></strong></td>
<td width="170"><strong><center>Procedencia</center></strong></td>
<td width="77"><strong><center>Precio</center></strong></td>
<td width="77"><strong><center>Stock</center></strong></td>
<td width="25" align="right"><a href="vercarrito.php?<?php echo SID ?>" title="Ver el contenido del carrito">
<img src="vercarrito.gif" width="25" height="21" border="0"></a></td>
</tr>
<?php
//mostramos todos nuestros
//artículos, viendo si han
//sido agregados o no a nuestro
//carro de compra
while($row=mysql_fetch_assoc($qry)){
?>
<tr>
<td><img src="http://jirehjoyas.cl/newSistema/fotos/<?php echo $row["imagen"?>"width="160" height="130" border="1"/></td>
<td><center><?php echo $row['descripcion'?></center></td>
<td><center><?php echo $row['observaciones'?></center></td>
<td><center><?php echo number_format($row['precio_tienda'],0,".",".");?></center><br></td>
<td><center><?php echo $row['stock'?></center></td>

<td>
<?php
if(!$carro || !isset($carro[md5($row['codarticulo'])]['identificador']) || $carro[md5($row['codarticulo'])]['identificador']!=md5($row['codarticulo'])){
//si el producto no ha sido
//agregado, mostramos la imagen
//de no agregado, linkeada
//a nuestra página de agregar
//producto y transmitíéndole a
//dicha página el id del artículo
//y el identificador de la sesión
?>
<a href="agregacar.php?<?php echo SID ?>&id=<?php echo $row['codarticulo']; ?>">
<img src="productonoagregado.gif" border="0" title="Agregar al Carrito"></a><?php }else
//en caso contrario mostramos la
//otra imagen linkeada., a la
//página que sirve para borrar el
//artículo del carro.
{?><a href="borracar.php?<?php echo SID ?>&id=<?php echo $row['codarticulo']; ?>">
<img src="productoagregado.gif" border="0" title="Quitar del Carrito"></a><?php ?></td>
</tr><?php ?>
</table>
              
     </div>
      
       </div> 
       </div> 
       </div> 
</div> 
       </div>
</body>
</html>
<?php
ob_end_flush
();
?>


porfavor amigos necesito realmente esta ayuda