The HTML for "These two scripts should be seperate." is executing prior to the last IF statement...
So if all IF statements are valid, the ""These two scripts should be seperate." will be between the "Supply and Protection Products" and "Clearance Products". Please help me figure this out!!
AdvTHANKSance!
<?
$day = "1970-10-08";
$stamp = strtotime ($day);
$nowday = date ("l, F jS, Y",$stamp);
$connection = mysql_connect("databaseserver", "myusername", mypassword")
or die ("Couldn't connect to server.");
$db = mysql_select_db("mytable", $connection)
or die ("Couldn't select database.");
$sql_countL = "SELECT COUNT(id) FROM master_cat
WHERE cat1 = \"L\" AND in_date = \"$day\" AND isbn > \"0000-00-00\" ";
$sql_countS = "SELECT COUNT(id) FROM master_cat
WHERE cat1 = \"S\" AND in_date = \"$day\" AND isbn > \"0000-00-00\" ";
$sql_countV = "SELECT COUNT(id) FROM master_cat
WHERE cat1 = \"V\" AND in_date = \"$day\" AND isbn > \"0000-00-00\" ";
$sql_countC = "SELECT COUNT(id) FROM master_cat
WHERE cat1 = \"C\" AND in_date = \"$day\" AND isbn > \"0000-00-00\" ";
$sql_countF = "SELECT COUNT(id) FROM master_cat
WHERE cat1 = \"F\" AND in_date = \"$day\" AND isbn > \"0000-00-00\" ";
$sqlC = "SELECT * FROM master_cat WHERE in_date = \"$day\" AND cat1 = \"C\" AND isbn > \"0000-00-00\" Order by title";
$sql_resultC = mysql_query($sqlC,$connection);
$sqlL = "SELECT * FROM master_cat WHERE in_date = \"$day\" AND cat1 = \"L\" AND isbn > \"0000-00-00\" Order by title";
$sql_resultL = mysql_query($sqlL,$connection);
$sqlV = "SELECT * FROM master_cat WHERE in_date = \"$day\" AND cat1 = \"V\" AND isbn > \"0000-00-00\" Order by title";
$sql_resultV = mysql_query($sqlV,$connection);
$sqlS = "SELECT * FROM master_cat WHERE in_date = \"$day\" AND cat1 = \"S\" AND isbn > \"0000-00-00\" Order by title";
$sql_resultS = mysql_query($sqlS,$connection);
$sqlF = "SELECT * FROM master_cat WHERE in_date = \"$day\" AND cat1 = \"F\" AND isbn > \"0000-00-00\" Order by title";
$sql_resultF = mysql_query($sqlF,$connection);
$sql_result_countL = mysql_query($sql_countL,$connection)
or die ("Couldn't get count!");
$sql_result_countS = mysql_query($sql_countS,$connection)
or die ("Couldn't get count!");
$sql_result_countV = mysql_query($sql_countV,$connection)
or die ("Couldn't get count!");
$sql_result_countC = mysql_query($sql_countC,$connection)
or die ("Couldn't get count!");
$sql_result_countF = mysql_query($sql_countF,$connection)
or die ("Couldn't get count!");
$countL = mysql_result($sql_result_countL,0,"count(id)");
$countS = mysql_result($sql_result_countS,0,"count(id)");
$countV = mysql_result($sql_result_countV,0,"count(id)");
$countC = mysql_result($sql_result_countC,0,"count(id)");
$countF = mysql_result($sql_result_countF,0,"count(id)");
IF ($countL + $countS + $countV + $countC + $countF !=0) {
echo "<div align=\"center\"><b><font size=\"+2\">New Products for $nowday </font></b></div>";
if ($countC > 0){
echo "
<table width=\"100%\" border=\"1\" cellpadding=\"1\">
<td colspan=\"4\" bgcolor=\"#CCFFCC\">
<div align=\"center\"><font size=\"+2\"><b>Comics</b></font></div>
</td> <tr>
<td><b><font size=\"+1\">Title</font></b></td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Price </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Disc </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Month </font></b></div>
</td>
</tr>";
while ($row = mysql_fetch_array($sql_resultC)) {
$id = $row["id"];
$title = $row["title"];
$price = $row["price"];
$disc = $row["disc"];
$isbn = $row["isbn"];
$month = date("n/y", strtotime($isbn));
echo "
<tr>
<td>$title</td>
<td><div align=\"center\"> $price </div></td>
<td><div align=\"center\"> $disc </div></td>
<td><div align=\"center\"> $month </div></td>
</tr>
";
}
}
if ($countL != 0){
echo "
<table width=\"100%\" border=\"1\" cellpadding=\"1\">
<td colspan=\"4\" bgcolor=\"#CCFFCC\">
<div align=\"center\"><font size=\"+2\"><b>Licenced Merchandise & Toys</b></font></div>
</td> <tr>
<td><b><font size=\"+1\">Title</font></b></td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Price </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Disc </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Month </font></b></div>
</td>
</tr>";
while ($row = mysql_fetch_array($sql_resultL)) {
$id = $row["id"];
$title = $row["title"];
$price = $row["price"];
$disc = $row["disc"];
$isbn = $row["isbn"];
$month = date("n/y", strtotime($isbn));
echo "
<tr>
<td>$title</td>
<td><div align=\"center\"> $price </div></td>
<td><div align=\"center\"> $disc </div></td>
<td><div align=\"center\"> $month </div></td>
</tr>
";
}
}
if ($countV != 0){
echo "
<table width=\"100%\" border=\"1\" cellpadding=\"1\">
<td colspan=\"4\" bgcolor=\"#CCFFCC\">
<div align=\"center\"><font size=\"+2\"><b>Videos and DVDs</b></font></div>
</td> <tr>
<td><b><font size=\"+1\">Title</font></b></td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Price </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Disc </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Month </font></b></div>
</td>
</tr>";
while ($row = mysql_fetch_array($sql_resultV)) {
$id = $row["id"];
$title = $row["title"];
$price = $row["price"];
$disc = $row["disc"];
$isbn = $row["isbn"];
$month = date("n/y", strtotime($isbn));
echo "
<tr>
<td>$title</td>
<td><div align=\"center\"> $price </div></td>
<td><div align=\"center\"> $disc </div></td>
<td><div align=\"center\"> $month </div></td>
</tr>
";
}
}
if ($countS != 0){
echo "
<table width=\"100%\" border=\"1\" cellpadding=\"1\">
<td colspan=\"4\" bgcolor=\"#CCFFCC\">
<div align=\"center\"><font size=\"+2\"><b>Supply and Protection Products</b></font></div>
</td> <tr>
<td><b><font size=\"+1\">Title</font></b></td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Price </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Disc </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Month </font></b></div>
</td>
</tr>";
while ($row = mysql_fetch_array($sql_resultS)) {
$id = $row["id"];
$title = $row["title"];
$price = $row["price"];
$disc = $row["disc"];
$isbn = $row["isbn"];
$month = date("n/y", strtotime($isbn));
echo "
<tr>
<td>$title</td>
<td><div align=\"center\"> $price </div></td>
<td><div align=\"center\"> $disc </div></td>
<td><div align=\"center\"> $month </div></td>
</tr>
";
}
}
if ($countF != 0){
echo "
<table width=\"100%\" border=\"1\" cellpadding=\"1\">
<td colspan=\"4\" bgcolor=\"#CCFFCC\">
<div align=\"center\"><font size=\"+2\"><b>Clearance Products</b></font></div>
</td><tr>
<td><b><font size=\"+1\">Title</font></b></td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Price </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Disc </font></b></div>
</td>
<td>
<div align=\"center\"><b><font size=\"+1\"> Month </font></b></div>
</td>
</tr>";
while ($row = mysql_fetch_array($sql_resultF)) {
$id = $row["id"];
$title = $row["title"];
$price = $row["price"];
$disc = $row["disc"];
$isbn = $row["isbn"];
$month = date("n/y", strtotime($isbn));
echo "
<tr>
<td>$title</td>
<td><div align=\"center\"> $price </div></td>
<td><div align=\"center\"> $disc </div></td>
<td><div align=\"center\"> $month </div></td>
</tr>
";
}
}
}
;
?>
<font size="+4" color="#FF0000">These two scripts should be seperate.</font>
<? echo "This is where script 2 is going to go"; ?>
Hope this makes sense.