title: Limiting while loop
body: <p>Is there a way to limiting while loops when fetching data from mysql ?</p>
  
  <pre><code>$query = "SELECT * 
      FROM  `table` 
      WHERE user_id = '$id' 
      ORDER BY `ID` DESC";
  
  $result = mysql_query($query);
  
  while ($info = mysql_fetch_assoc($result)) {
      //stuff
  }
  </code></pre>
  
  <p>Here i dont want to use mysql's LIMIT function, can i limit while loop other than that one ?</p>
  
  <p>Thanks</p>