title: Most efficient way of calling similar query in three places on one page
body: <p>I've got a PHP page that calls almost the same query three times in the page and wanted to see if there was a quicker way of using this rather than in three seperate instances.</p>
  
  <p>the queries are, in essence</p>
  
  <pre><code>select * from dbo.function('foo','bar') 
  where userid = $userid 
  and status = 'Yes'
  
  select * from dbo.function('foo','bar') 
  where userid = $userid 
  and status = 'No' 
  and value &gt;= 0
  
  select * from dbo.function('foo','bar') 
  where userid = $userid 
  and status = 'No' 
  and value &lt; 0
  </code></pre>
  
  <p>Each time I'm displaying the data in a different table, but wanted to see if there was a more efficient way than querying the database three times.</p>