Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/02/2012, 04:00
edie8
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: Problemas con array

Se me olvido poner el codigo que yevo hecho aunque no me funciona y tengo una monta....
Código PHP:
<?php
include('../config.php');
$resultados=mysql_query("select * from imagenes where id_logueado='$id_usuario'",$conexion) or 
  die(
"Problemas en el select:".mysql_error());
$i 0;
$arr=array();
  while(
$fot=mysql_fetch_assoc($resultados)) 

$clase = (isset($i))? "class='primero'""";
$foto_nombre=$fot['nombre'];
$foto_id=$fot['id'];
$arr[]=$foto_nombre;

}

$registros=mysql_query("select count(*) as cantidad  from imagenes where id_logueado='$id_usuario'",$conexion) or
  die(
"Problemas en el select:".mysql_error());
  
$reg=mysql_fetch_array($registros);
  
$cantidad=$reg['cantidad'];
  if(
$_POST["img"] == 4)
    echo 
$arr[1];
else
    echo 
$arr[$_POST["img"]+1];
?>
<img src="<?php echo $arr[0]; ?>" />
Os agradezco la ayuda, nunca e trabajado con array y menos sacando valores desde base de datos, gracias.