tengo un problema y la verdad nose como solucionarlo...
cuando lo monto en el servidor (xampp) y quiero ver la img de la base de dato me muestra solo la primera..no la correspondiente por cada id de imagen, les agradecería la ayuda
codigo php:
Código HTML:
}else{
$consulta=mysqli_query($conexion,"SELECT * FROM productos");
}
//$cont=0;
while ($registro=mysqli_fetch_array($consulta)){
//$cont++;
?>
<tr>
<td><?php echo $registro["id"]; ?></td>
<td><?php echo $registro["nombre"]; ?></td>
<td>
<?php
?>
<a href="descripcion.php?id=<?php echo $registro["id"]; ?>" target="_blank" onclick="window.open(this.href, this.target, 'width=500, height=500, top=0, left=0,'); return false;">Ver mas</a>
<?php
?>
</td>
<td><?php echo $registro["precio"]; ?></td>
<td><?php echo $registro["stock"] ?></td>
<td>
<?php
if ($registro["disponibilidad"]==1) {
echo "si";
}else{
echo "no";
}
?>
</td>
<td>
<a onClick="flotante(1)"><!--<?php //echo "ver".$cont; ?></a>
<div id="contenedor" style="display:none">
<div id="flotante">
<img src="<?php echo $registro["img"]; ?>">
<p><?php echo $registro["id"]; ?></p>
<a onClick="flotante(2)">Cerrar</a>
</div>
<div id="fondo" onclick="flotante(2)"></div>
</div>
</td>
<td><?php echo $registro["categoria"]; ?></td>
<td>
<a class="icon-pencil2" href="formulario.php?id=<?php echo $registro["id"]; ?>"></a>
</td>
<td>
<a class="icon-bin2" href="eliminar.php?id=<?php echo $registro["id"]; ?>"></a>
</td>
</tr>
<?php
}
?>
el codigo jquery por las dudas
function flotante(tipo){
if (tipo==1){
//Si hacemos clic en abrir mostramos el fondo negro y el flotante
$('#contenedor').show();
$('#flotante').animate({
marginTop: "-390px"
});
}
if (tipo==2){
//Si hacemos clic en cerrar, deslizamos el flotante hacia arriba
$('#flotante').animate({
marginTop: "-1756px"
});
//Una vez ocultado el flotante cerramos el fondo negro
setTimeout(function(){
$('#contenedor').hide();
},500)
}
}