I'm have a database of images that looks like this:
Image | Title | URL
img1 til1 url1
img2 til2 url2
I'm trying to show a random image on my front page, but everytime the page loads, I get the same image. Even if i went to the page a day later.
Any ideas what i'm doing is wrong?
Here's the code:
<?php
$result = mysql_query("SELECT *,RAND() AS ran FROM posters ORDER BY ran LIMIT 1 ",$db);
$myrow=mysql_fetch_array($result);
printf("<img src=\"%s\">",$myrow["img"]);
?>
Thanks on advance for the help.
-Manuel