$atras = mysql_query('SELECT id FROM galeriaboda ORDER BY $id ASC LIMIT $id-1,1'); while ($row = mysql_fetch_row($atras)){ echo "$row[1] \n";