$query = "SELECT * FROM nuke_phpbb_album ORDER BY RAND(MD5(NOW))) LIMIT 1"; $result = mysql_query($query); $picrow = mysql_fetch_assoc($result); $picid = $picrow['id']; //I don't know what the column name is so you would need to insert that here instead of 'id'
This allows the mysql server to do the work of finding a random row. Not sure if it is really more or less effecient, just a different way of doing it.
**unknown user**
Rank: Registered User
Registered: Mar 16, 2002
Last visit: Oct 21, 2009
Posts: 8
Posted: Feb 11, 2004 - 03:44 AM
Hi,
Is it possible to create a "Recent Picture" block for Smartor's album with something like what you have here for "random block"? Can anyone please post code for it here? Your help will be greatly appreciated.