The qrtrly is the date. Here is the rest of the script:
$chk_id = "SELECT vid FROM insp WHERE vid = \"$vid\"";
$chk_id_res = @($chk_id,$connection) or die("Couldn't execute query.");
$chk_id_num = mysql_num_rows($chk_id_res);
if ($chk_id_num == "0") {
echo "$logo";
echo "<body bgcolor=\"$bg_color\" background=\"$background\" text=\"$tcolor\"";
echo "<p> <i><font size=\"3\" face=\"arial\" color=\"#000000\">Sorry, No Inspection Record Found!</font></i></p>";
echo " <a href=\"view_allunits.php\"><img src=\"images\back.gif\" border=\"0\"></a>";
echo "<br> $author";
exit;
} else {
echo "$logo";
echo "<body bgcolor=\"$bg_color\" background=\"$background\" text=\"$tcolor\"";
$sql = "
SELECT *
FROM insp, lsv
WHERE insp.vid = \"$vid\"
AND (insp.vid = lsv.vid)
ORDER BY insp.qrtrly DESC
LIMIT 1
";
$result = @($sql,$connection) or die("Couldn't execute query.");
$the_insp = "
<table width=250 cellpadding=2 cellspacing=2 border=0>
<tr>
<td bgcolor=#800000 width=100><font size=1 face=arial color=#ffffff>Inspection Date:</font></td>
<td bgcolor=#800000 width=150><font size=1 face=arial color=#ffffff>Performed By:</font></td>
</tr>
";
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$vid = $row['vid'];
$qrtrly = $row['qrtrly'];
$tech = $row['tech'];
$reg = $row['reg'];
$sn = $row['sn'];
$org = $row['org'];
$vco_n = $row['vco_n'];
$vco_e = $row['vco_e'];
$the_insp .= "<tr>
<td bgcolor=#ECDC94 width=100><font size=1 face=arial>$qrtrly</font></td>
<td bgcolor=#ECDC94 width=150><font size=1 face=arial>$tech</font></td>
";
}
$the_insp .= "</tr></table>";
echo "
<br><br>
<table width=450 cellpadding=2 cellspacing=2 border=0>
<tr>
<td><font size=2 face=arial width=150><b>Cart Plate Number:</b></font></td>
<td><font size=2 face=arial width=300>$reg</font></td>
</tr>
<tr>
<td><font size=2 face=arial width=150><b>Cart Serial Number:</b></font></td>
<td><font size=2 face=arial width=300>$sn</font></td>
</tr>
<tr>
<td><font size=2 face=arial width=150><b>Organization:</b></font></td>
<td><font size=2 face=arial width=300>$org</font></td>
</tr>
<tr>
<td><font size=2 face=arial width=150><b>VCO:</b></font></td>
<td><font size=2 face=arial width=300>$vco_n</font></td>
</tr>
<tr>
<td><font size=2 face=arial width=150><b>Phone:</b></font></td>
<td><font size=2 face=arial width=300>$vco_e</font></td>
</tr>
</table>
";
echo "<br> <table width=\"700\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">
<tr>
<td width=\"250\" valign=\"top\"></td>
<td width=\"450\" valign=\"top\"><font size=\"2\" face=\"arial\">
Last Inspection Completed On: <font face=\"arial\" size=\"3\"><b>$qrtrly</b></font>
<br><br>
It Was Performed By: <font face=\"arial\" size=\"3\"><b>$tech</b></font>
<br><br>
Next Inspection Due On or Before:
<br><br>
<font face=\"arial\" size=\"3\"><b>$nextdue</b></font>
<br><br>
</font></td>
</tr>
</table>
";
echo "<br> $author";
exit;
}
?>
Thanks for your inputs.
:o) Ivan