title: Displaying random mysql records - PHP
body: <p>Im trying to display a random record from my table but with no luck this is what I have upto. This is coded in PHP</p>
  
  <pre><code>$range_result = mysql_query("SELECT MAX() AS max_id , MIN() AS min_id FROM pages");
  $range_row = mysql_fetch_object( $range_result ); 
  $random = mt_rand($range_row-&gt;min_id , $range_row-&gt;max_id);
  $result_random = mysql_query( "SELECT * FROM pages WHERE id &gt;= $random LIMIT 0,1");
  echo $result_random;
  </code></pre>
  
  <p>Wondering if this is an obvious mistake? I have connected to the database fine.</p>
  
  <p>JB</p>