I swear, this is about to drive me mad -- I've got some info in a database that includes links to images and some text for each image -- and I just want to pull a random row from the database, and display the image with the text. I've been reading through the forums, and found the following way to pull a random row from my table:
$result = mysql_query("SELECT * FROM random_block ORDER BY RAND() LIMIT 1");
$block = mysql_fetch_array($result);
echo "$block[image] $block[text]";
The thing that's driving me crazy is that although there are 5 items in the database, it keeps pulling up only the first one. Sometimes, if I hold down shift+refresh, I can get it to pull another row (image+text) but not always. Is this a caching problem? And is there anyway to force it to display a different item each time?