hey, i have a mysql db with urls of images and all there id's are set to 1
i have this script that is supposed to select a random image, but it always selects that same image all the time. I am using this for a random avatar thingie.
<?php
$thisdb = mysql_connect("localhost","user","pass");
mysql_select_db("database",$thisdb);
$sql = "SELECT * FROM randomavatars WHERE id=$set ORDER BY RAND()";
$result = mysql_query($sql,$thisdb);
$array = mysql_fetch_array($result);
// Output header for path for first image
header("Location: " . $array["path"]);
?>
The db looks a lil like this but longer, 21 entries (the images are made up)
id | path
1 | http://www.google.com/.........
1 | http://www.yahoo.com/monkey.gif
and for the avatar file use instead of a image file is avatar.php?set=1
please help