1 && $Idi<6){$Idi--;}else{$Idi=1;} $qf="select A.Foto from Imagen A,Imagen_idioma B where A.Codnot=$Codnot and A.Codimg=B.Codimg and B.Codid=$Idi and A.Activo='Si' order by A.Orden"; $Idi++; } //echo($qf); $resf=mysql_db_query ($db, $qf); if (mysql_num_rows($resf)>0) { $rowf= mysql_fetch_row ($resf); $Foto=$rowf[0];?>