Hi I'm wondering how i would display the error message I have in here properly... its supposed to only display when I don't have data. But even when I do have data, it still displays:
The error has something to do with $title_display not working properly.
if (isset($BASIC)){
$sql = "select * from areas ORDER BY sortingorder ASC";
$result = mysql_query($sql);
while ($owners = mysql_fetch_array($result))
{
$id=$owners['id'];
$area2=$owners['name'];
$shows=$owners['shows'];
$sql2 = "select * from project_master, newproject_data WHERE newproject_data.nprojectID = project_master.nprojectID AND project_master.area1 = '$area2' AND newproject_data.published = 'YES' AND newproject_data.date = '$issue_select' ORDER BY project_master.project_address ASC";
$result2 = mysql_query($sql2);
$num_rows = mysql_num_rows($result2);
$title_display == 1;
if ($num_rows == 0){
/* CODE TO GENERATE ERROR MESSAGE IF THERE ARE NO RESULTS FOR THAT ISSUE */
if ($title_display == 1) {
echo "<br><br><span class=alerts2><font color=#000000>Please return to the last issue for information under this heading, or select another component.<br>If you believe this message is in error, please contact our office.</font></span>";
}
$title_display == $title_display ++;
}else{
while ($south = mysql_fetch_array($result2))
{
$nprojectID=$south['nprojectID'];
$area1=$south['area1'];
$issue_date=$south['issue_date'];
$updissue_date=$south['updissue_date'];
$last_issue=$south['last_issue'];
$project_address=$south['project_address'];
$project_type=$south['project_type'];
$comments=$south['comments'];
$project_description=$south['project_description'];
$newproject=$south['newproject'];
$updatedproject=$south['updatedproject'];
$prebid=$south['prebid'];
$newtender=$south['newtender'];
$updatedtender=$south['updatedtender'];
$bidresults=$south['bidresults'];
/************************************* BEGIN PROJECT DISPLAY **************************************/
echo "<tr><td colspan=3><br><br><span class='area-title'><strong>$area1</strong></span><span class=bodytext> - $project_address (<span class=published-text2>$project_type</span>) - $project_description</span></td></tr>";
/************************************* END PROJECT DISPLAY **************************************/
/************************************* BEGIN PROJECT DETAIL DISPLAY **************************************/
/* This is the category name */
$sql = "SELECT * FROM project_crosslink WHERE projectID = $nprojectID ORDER BY orderID,category";
$results = mysql_query($sql);
while ($crosslink = mysql_fetch_array($results))
{
$catID = $crosslink['catID'];
$detailID = $crosslink['detailID'];
$sql2 = "SELECT * FROM category WHERE catID = $catID";
$results2 = mysql_query($sql2);
$category_results = mysql_fetch_array($results2);
$name = $category_results['catSelect'];
$catID_match = $category_results['catID'];
$sql3 = "SELECT description FROM projectdata_details WHERE projID = $detailID";
$results3 = mysql_query($sql3);
$details_results = mysql_fetch_array($results3);
$detail = $details_results['description'];
//// RESTRICT CATEGORIES TO THE FOLLOWING ////
$restrict = array(123, 124, 125, 126, 127, 128, 129, 130, 131);
if(!in_array($catID_match, $restrict))
{
echo"<tr>";
echo"<td width='150' valign=top>";
echo "<span class='headers3'>$name</span>";
echo"</td>";
echo"<td width='8' valign=top>";
echo"<span class='bodytext'>:-</span><br>";
echo"</td>";
echo"<td valign=top>";
echo"<span class='bodytext'>$detail</span><br>";
echo"</td>";
echo"</tr>";
}
}
/************************************* END PROJECT DETAIL DISPLAY **************************************/
}
}
}
} ///END BASIC