(php begginer)
here is the situation, I want to display a random header on my website every time someone accesses a page, so I made a table (headers) in mysql using header_id, and location (ex. headers/header1.jpg)
so I tried to generate a random number using 1 and the number of entries, I then used a query to get the contents of location for that entry, but the code wont show as a picture
sample script,
$getrows=mysql_query("select * from headers");
$numberofrows=mysql_num_rows($getrows);
$number=rand (1, $numberofrows);
$array=mysql_query("SELECT location FROM headers where headerid = $number");
$image=mysql_query($array);
echo "<img src='$image'>";