Lo he hecho tal como digiste pero sige sin funcionar mira este es el codigo:
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();
$fot=mysql_fetch_assoc($resultados);
$foto_nombre=$fot['nombre'];
$arr= array($i=> $foto_nombre);
echo '<img scr="'.$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"] == $cantidad)
{
?><img src="<?php echo $arr[$i]; ?>" rel="$i" /><?php
}
else
{
?><img src="<?php echo $arr[$_POST["img"]+1];?>" rel="<?php echo $arr[$_POST["img"]+1];?>"/><?php
}
echo $_POST['img'];
$i++;
?>
Ahora no me muestra ninguna imagen de las que antes me mostraba, que es lo que tengo mal??? gracias por la ayuda.