Hi, guys.
I am trying to make a simple .PHP code that will create a random banner in 1 location
I put all the picture/link info in a table in my MYSQL DB..
And now I just ned a simple .PHP code that will create 1 random image at single location.
Hope this makes sense!
I did something like this before except it involved using several images and was also for my vbulletin forums. I am just trying to create something for a regular .PHP website...
Well here was the old code I used:
Maybe this will help in the creation of the new code?
$sql = "SELECT * FROM `ads` ORDER BY RAND()";
$result = mysql_query($sql) or die(mysql_error());
$ads = array();
while ($row = mysql_fetch_object($result))
{
$ad =& $ads[];
$ad['HREF'] = $row->HREF;
$ad['SRC'] = $row->SRC;
$ad['ALT'] = $row->ALT;
}
<tr><td>
<a href='{$ads[0]['HREF']}'><img src='{$ads[0]['SRC']}' alt='{$ads[0]['ALT']}' border=0></a></td></tr>