I am trying to create an advertisement table just like LS1tech.com...
Yet I am having some difficulties...
NOTE: I am using Vbulletin...
This is my database that I have setup:
http://img107.imageshack.us/img107/4594/help6oo.jpg
Since the advertisement table is in th template I can not directly use php...
I need to put the php in another file and then call on it in the template...
Here is what I have so far:
$sql = "SELECT * FROM `table_name` ORDER BY RAND()";
$result = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_object($result))
{
$ads_HREF = "$row->HREF";
$ads_SRC = "$row->SRC";
$ads_ALT = "$row->ALT";
}
and I call on it with this:
<tr><td>
<a href='$ads_HREF'><img src='$ads_SRC' name='$ads_ALT' border=0></a></td></tr>
but... there is a problem with this... it shows the same ad 5 times! I want 5 different ads!
I think I may need to use an array... but I am not sure how...
Anyone want to help?