title: Select nth record from a SQL result set in php
body: <p>I run a query and get a result set. I need to get the nth record from this result set. Any ideas how I can do this?</p>
  
  <p>I cannot select the nth record from the database directly coz I need to filter it and don't know how many records there are in the result set. So I cannot be certain which number to pass to the mysql_result method i.e.</p>
  
  <ol>
  <li>Based on certain conditions, get a few rows from a table</li>
  <li>From these rows, select the nth row (the number n is not fixed. It depends on the number of records returned)</li>
  </ol>
  
  <p><strong>The basic idea is to get all results based on a set condition and get a random result from these.</strong></p>
  
  <p>Any ideas? Thanks.</p>