Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/05/2016, 22:48
Avatar de aviweb2015
aviweb2015
 
Fecha de Ingreso: abril-2016
Ubicación: venezuela
Mensajes: 215
Antigüedad: 8 años, 10 meses
Puntos: 1
Respuesta: mostrar productos por su categorias

ok ya me fije en ese detalle




productos.php

Código PHP:
Ver original
  1. <?php
  2. include 'conexion.php';
  3. $re=mysql_query("select * from productos group by idcategorias")or die(mysql_error());
  4. while ($f=mysql_fetch_array($re)) {
  5. ?>
  6. <div class="producto">
  7. <center>
  8. <img src="./imagenes/<?php echo $f['imagen'];?>"><br>
  9. <span><?php echo $f['idcategorias'];?></span><br>
  10. <a href="detalles_productos.php?idcategorias=<?php  echo $f['idcategorias'];?>">ver</a>
  11. </center>
  12. </div>
  13. <?php
  14. }
  15. ?>



detalles_productos.php
Código PHP:
Ver original
  1. <?php
  2.  
  3. include 'conexion.php';
  4. $re=mysql_query("select * from productos where idcategorias='idcategorias'")or die(mysql_error());
  5. while ($f=mysql_fetch_array($re)) {
  6.     print ''.$f['idcategorias'].''
  7. ?>
  8. <div class="producto">
  9.             <center>
  10.                 <img src="./imagenes/<?php echo $f['imagen'];?>"><br>
  11.                 <span><?php echo $f['descripcion'];?></span><br>
  12.                 <a href="detalles.php?id=<?php  echo $f['id'];?>">ver</a>
  13.                 <br><br>
  14.                 <a href="productos.php" class="aceptar">Regresar</a>
  15.             </center>
  16.         </div>
  17.     <?php
  18.         }
  19.     ?>


y en la barra del navegador me muestra lo siguiente: detalles_productos.php?idcategorias=Sillas

pero la consulta se me muestra en blanco osea no muestra nada
__________________
yoclens avilan