I'm sorry I already have that done and it still is giving me "Couldn't execute query."
Here's my entire clip:
<?
include("config.inc");
$db_name = "$db";
$connection = @mysql_connect("$server", "$user", "$password") or
die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select
database.");
$chk_id = "SELECT org from lsv WHERE org = \"$org\"";
$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 Records Found!</font></i></p>";
echo "<br> $author";
exit;
} else {
$sql = "
SELECT *
FROM lsv, insp, insp.qrtrly + INTERVAL 90 DAY as nextdue
WHERE lsv.vid = \"insp.vid\"
";
$result = @($sql,$connection) or die("Couldn't execute query.");
}
$the_unit = "
<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td>
<br>
<center>
<b><font size=\"3\" face=\"arial\" color=\"#800000\">$org Golf Cart / LSV's Inspection Dates</font></b>
<br>
</center>
</td>
</tr>
</table>
<table width=100% cellpadding=2 cellspacing=2 border=0>
<tr>
<td bgcolor=#800000><font size=1 face=arial color=#ffffff>Registration:</font></td>
<td bgcolor=#800000><font size=1 face=arial color=#ffffff>Serial Number:</font></td>
<td bgcolor=#800000><font size=1 face=arial color=#ffffff>Office Stmbol:</font></td>
<td bgcolor=#800000><font size=1 face=arial color=#ffffff>Inspection Date:</font></td>
<td bgcolor=#800000><font size=1 face=arial color=#ffffff>Next Due:</font></td>
</tr>
";
while ($row = mysql_fetch_array($result)) {
$vid = $row['vid'];
$reg = $row['reg'];
$sn = $row['sn'];
$org = $row['org'];
$offsym = $row['offsym'];
$vco_n = $row['vco_n'];
$vco_e = $row['vco_e'];
$qrtrly = $row['qrtrly'];
$the_unit .= "<tr>
<td bgcolor=#ECDC94><font size=1 face=arial><a href=\"view_single.php?vid=$vid\">$reg</a></font></td>
<td bgcolor=#ECDC94><font size=1 face=arial>$sn</font></td>
<td bgcolor=#ECDC94><font size=1 face=arial>$offsym</font></td>
<td bgcolor=#ECDC94><font size=1 face=arial>$qrtrly</font></td>
<td bgcolor=#ECDC94><font size=1 face=arial>$nextdue</td>
";
}
$the_unit .= "</tr></table>";
?>