alright,have it down to two error messages. Any help appreciated:
note:
raised 'mysql_select_db' to eliminate other errors.
created AND MCatID = ' . $MCatID . ' // instead of '%s'
Notice: Undefined variable: $removed // blue line
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource // same line
<?
mysql_select_db($database_removed, $removed);
function getItemCount($XLAFIPS, $MCatID) {
$colname_XLA6 = "6037";
if (isset($HTTP_GET_VARS['XLAFIPS'])) {
$colname_XLA6 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['XLAFIPS'] : addslashes($HTTP_GET_VARS['XLAFIPS']);
}
$query_XLA6 = sprintf("SELECT COUNT(*) as theCount FROM XMem, Mcateg
INNER JOIN XMcounty ON XMem.XMemID = XMcounty.XMcXMemID
INNER JOIN commercial9 ON commercial9.CountyFIPS =XMcounty.XMcountyFIPS
AND commercial9.CommID = (
SELECT max( commercial9.CommID )
FROM commercial9 WHERE CountyFIPS = '%s' )
INNER JOIN XMwcat ON XMem.XMemID = XMwcat.XMwXMemID
WHERE XMwcat.XMwCatID = Mcateg.MCatID
AND MCatID = ' . $MCatID . ' GROUP BY NULL ", $colname_XLA6, $MCatID);
$XLA6 = mysql_query($query_XLA6, $removed) or die(mysql_error());
$row = mysql_fetch_assoc($rs);
return $row['theCount']; }
$colname_XLA6 = "6037";
if (isset($HTTP_GET_VARS['XLAFIPS'])) {
$colname_XLA6 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['XLAFIPS'] : addslashes($HTTP_GET_VARS['XLAFIPS']);
}
<table width="50" height="40" border="1" bordercolor="#666666">
<tr>
<td><?= getItemCount($colname_XLA6, 71) ?></td>
<td><?= getItemCount($colname_XLA6, 20) ?></td>
</tr>
<tr>
<td><?= getItemCount($colname_XLA6, 40) ?></td>
<td><?= getItemCount($colname_XLA6, 63) ?></td>
</tr>
</table>