s there a way to make this more random ?
$result = mysql_query('SELECT * FROM pictures ORDER BY RAND() LIMIT 1');
If your database is small,you should use RAND() otherwise try another solutions as like mentiones in the link that lukeg gave you
Use this
$range_result = mysql_query( " SELECT MAX(`id`) AS max_id , MIN(`id`) AS min_id FROM `table` ");
$range_row = mysql_fetch_object( $range_result );
$random = mt_rand( $range_row->min_id , $range_row->max_id );
$result = mysql_query( " SELECT * FROM `table` WHERE `id` >= $random LIMIT 0,1 ");
anyquestion.webvertex.co.in (http://anyquestion.webvertex.co.in)
thanks for sharing sam! you are good programmer.