Jump to content

[SOLVED] banner ad help


DasHaas

Recommended Posts

im sure this is an easy one to solve, but I cant seem to figure it out. Im got the ads to show but it shows all the ads in my database and is looks horrible. I would like to display only one ad at a time.

 

here is my code:

<?php
$query = "SELECT HREF, SRC, ALT FROM PXS_Ads WHERE status = 1 and impressions_left>0 ORDER BY RAND()";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
while ($row = mysql_fetch_object($result))
{
    $HREF = "$row->HREF";
    $SRC = "$row->SRC";
    $ALT = "$row->ALT";

?>
      <table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td scope="col"><a href='<?php echo($HREF); ?>'><img src='<?php echo($SRC); ?>' name='<?php echo($ALT); ?>' border=0></a></td>
	<?php
}//close while;
//continue code
?>

 

any elp would be greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/62886-solved-banner-ad-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.