title: Looping sql statement return so slow
body: <p>first, I make select statement in another function. </p>
  
  <p>From that another function, I get some fields from my table in database in which one of them is for instance a field of <code>variable</code>.</p>
  
  <p>From that sql statment I got 10000 rows or more. </p>
  
  <p>I take that field of <code>variable</code> to make a sql statement again. </p>
  
  <pre><code>    $variable = (10000 values here)
  </code></pre>
  
  <p>And then I tried to do sql select statement based on the value: </p>
  
  <pre><code>$sql = $this-&gt;db-&gt;query
  
      ("   
          SELECT logintime FROM game_login WHERE data_id = '".$variable ."'
  
      "); 
  </code></pre>
  
  <p>In another words, it meant that I do 10000 select statements. </p>
  
  <p>And it makes my query so slowssss.</p>
  
  <p>How to fix this so that the query run fast? </p>
  
  <p>Thanks in advance. </p>