MySQL has an mathemetical function to generate a random number with a value between 0.0 and 1.0 but this won't help you much, i suppose.<br /><br />You could also try something like this, which works good on small tables:<br /><br />SELECT * FROM tablename where B_Posted > '$startdate' and B_Posted < '$enddate' ORDER BY RAND() LIMIT 1<br /><br />This is not a good idea if your posts table has moore than about 300.000 entries.<br /><br />Since the startdate and enddate changes each month, you need to write a script anyway.<br />So generating a random number could be done with php also.<br />Something like this should work:<br /><br />SELECT MIN(B_Number), MAX(B_Number) where B_Posted > '$startdate' and B_Posted < '$enddate' FROM tablename;<br /><br />Fetch the result into $a<br /><br />$id=rand($a[0],$a[1]);<br /><br />SELECT * FROM tablename WHERE B_Number>='$d' LIMIT 1
_________________________
Running a community? ->
Keep informed and take it to the next level