Foros del Web » Programando para Internet » Jquery »

php mysql y javascript

Estas en el tema de php mysql y javascript en el foro de Jquery en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 18/05/2016, 23:53
 
Fecha de Ingreso: mayo-2016
Mensajes: 1
Antigüedad: 7 años, 11 meses
Puntos: 0
Exclamación php mysql y javascript

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)
}
}

Etiquetas: javascript, javascript+html, php
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 23:20.