Hello everyone
i have a problem if an if else statement its not outputting the else part of it
the code i have is shown below:
$result = mysql_query($query, $db);
if ($result)
{
While($rec = mysql_fetch_array($result))
{
echo("<center><h2>Validation Details</h2></center>");
echo("<div align=\"center\">");
echo("<table width=\"375\" border=\"1\">");
echo("<tr>");
echo("<td width=\"175\"><b>Validation Date:</b></td>");
echo("<td width=\"184\">" . $rec["valid_date"] . "</td>");
echo("</tr>");
echo("<tr>");
echo("<td><b>Next Review Date:</b></td>");
echo("<td>" . $rec["next_review_date"] . "</td>");
echo("</tr>");
echo("<tr>");
echo("<td><b>Validation Notes:</b></td>");
echo("<td>" . $rec["notes"] . "</td>");
echo("</tr>");
echo("</table><br></div>");
}
} else {
echo("Sorry there is no extra information about this programme<br>");
echo("Please contact the QSU department because the database must not be up to date<br>");
echo("Sorry for the inconvenice");
}
?>
Like i say it shows the if part of the statement but when a programme hasnt got some of the SQL statement data i would like the else statement to appear instead.
thanks for any help in advance
snoopgreen