title: Mysql result table joining multiple SELECT results inside a while loop
body: <p>has anyone have an idea of ​​the most efficient way to turn this into a while loop in Mysql?.</p>
  
  <pre><code>select * from 1eg_usuarios where 
          user_id_1eg= (select @ult_anf:= id_anfitrion_1eg from 1eg_usuarios where user_id_1eg=121) #40
          or
          user_id_1eg= (select @ult_anf:= id_anfitrion_1eg from 1eg_usuarios where user_id_1eg=@ult_anf) #13
          or
          user_id_1eg= (select @ult_anf:= id_anfitrion_1eg from 1eg_usuarios where user_id_1eg=@ult_anf) #4
          or
          user_id_1eg= (select @ult_anf:= id_anfitrion_1eg from 1eg_usuarios where user_id_1eg=@ult_anf); #1
  </code></pre>
  
  <p>Thanks.</p>