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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.