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
$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->min_id , $range_row->max_id);
$result_random = mysql_query( "SELECT * FROM pages WHERE id >= $random LIMIT 0,1");
echo $result_random;
Wondering if this is an obvious mistake? I have connected to the database fine.
JB