I'm sure this has a simple solution...
I want to display a random record from a table in my database.
$db = mysql_connect("localhost");
mysql_select_db("movies",$db);
$query = "SELECT Name FROM tblMovies";
$result = mysql_query($query);
mt_srand(time());
//Get a random number between 1 and the total number of rows
$val = mt_rand(1,mysql_num_rows($result));
So I guess my question is, how can I get the info from row number $val ??
I can think of several ways to go about doing this, but they all seem like alot more work and code then is needed. Does anyone know of a quick and simple way of doing this?