}
$pk = '';
$result = mysql_query("SHOW COLUMNS FROM {$table}");
while ($result && ($row = mysql_fetch_row($result))) {
    if ($row[3] == 'PRI') {
        $pk = $row[0];
    }
    break;
}
if (empty($pk)) {
    echo '1';
    exit;
}
// load table
$tableObj = new Table($table, FALSE);
$directAssocMatchArray = $tableObj->getDirectAssocMatch($fieldName);
//print_r($tableObj);
if (count($directAssocMatchArray) <= 0 && empty($directAssocMatchArray)) {
    echo '1';
    exit;
}
if ($debug) {
    echo '<pre>' . "\n";
}
echo '{' . "\n\n";
echo '  "rowPk": \'' . $pk . '\',' . "\n";
// grab the value of the current table
$result = mysql_query("SELECT {$fieldName} FROM {$table} WHERE {$pk} = {$rowPk}");
if (mysql_num_rows($result) <= 0) {
    $currentTableValue = '0';
} else {