I am not too sure how to explain this so the professionals can understand as I am not formally trained in the correct language, but here goes.
I have a page set with a banner ad and a skyscraper ad. Now the code I am using to call the banner is this:
Oh, I do have a configuration file that does get included.
<?
$sql3 = "SELECT ADKey,ADWeb,ADImage,ADType
FROM $table_adsales
WHERE ADKey = '$PageID' AND ADType = 'Banner'
";
$result3 = @($sql3,$connection) or die("couldn't execute query");
while ($adrow = mysql_fetch_array($result3)) {
$ADKey = $adrow['ADKey'];
$ADWeb = $adrow['ADWeb'];
$ADImage = $adrow['ADImage'];
$ADType = $adrow['ADType'];
if (($ADType == "Banner") && ($ADWeb == "")) {
echo"<img src=\"../ads/$ADImage\" border=1 style=\"border-color:black\">
";
} else
echo ("<a href=\"http://$ADWeb\" target=\"_blank\"><img src=\"../ads/$ADImage\" border=1 style=\"border-color:black\"></a>
");
}
?>
the script for the skyscraper ad is this:
<?
include("../sql/configuration.php");
$sql2 = "SELECT ADKey,ADWeb,ADImage,ADType
FROM $table_adsales
WHERE ADKey = '$PageID' AND ADType = 'Skyscraper'
";
$result2 = @($sql2,$connection) or die("couldn't execute query");
while ($adrow = mysql_fetch_array($result2)) {
$ADKey = $adrow['ADKey'];
$ADWeb = $adrow['ADWeb'];
$ADImage = $adrow['ADImage'];
$ADType = $adrow['ADType'];
if (($ADType == "Skyscraper") && ($ADWeb == "")) {
echo"<table border=0 cellpadding=2 cellspacing=1 width=130 bgcolor=\"#ffff99\">
<tr bgcolor=\"#FFFFFF\">
<td align=\"center\" valign=\"top\"><img src=\"../ads/$ADImage\" border=0></td>
</tr></table>";
} else
echo ("<table border=0 cellpadding=2 cellspacing=1 width=130 bgcolor=\"#ffff99\">
<tr bgcolor=\"#FFFFFF\">
<td><a href=\"http://$ADWeb\" target=\"_blank\"><img src=\"../ads/$ADImage\" border=0></a></td>
</tr>
</table>");
}
?>
What I am trying to do is match up the PageID that I am using in the URL, I guess you would call it a get function.
<a href="sitename.php?PageID=chi_index&StatsID=chicago_stats">chicago</a>
now this is how I learned how to pass variables to the next page for processing, but what I am finding out is that once the banner script is processed, the skyscraper won't query, though I could have the query not set up properly?
I do use one table for both the banner and the skyscraper ad information and place an include file for the banner and skyscraper.
I have had this problem before when ever I try to "cross" query information, or what I call cross query, when you are using the same table and fields to call information within different sections of the page.
What is the best way to do this so I don't get any road blocks?
thanks,
Brett