Forum Moderators: coopster
## $targetTable: this variable changes
## $primary: this variable changes
## $primaryValue: this changes
## $rowName: this changes
$result = mysql_query("SELECT * FROM ".$targetTable." WHERE ".$primary." LIKE '".$primaryValue."'");
while($row = mysql_fetch_array($result)) {
$want = $row['$rowName'];
echo $want ;
} $result = mysql_query("SELECT * FROM `{$targetTable}` WHERE '{$primary}' LIKE '{$primaryValue}'"); //MATTHEW'S CODE (MINOR CORRECTION OF MISSING BRACE)
$result = mysql_query("SELECT * FROM `".$targetTable."` WHERE '".$primary."' LIKE '".$primaryValue."'");
while($row = mysql_fetch_array($result)) {
$want = $row[$rowName];
echo $want;
}
$offset = ($rowNum-1);
$result = mysql_query("SELECT * FROM `{$targetTable}` WHERE '{$primary}' LIKE '{$primaryValue}' LIMIT 1 OFFSET {$offset}"); $colName = $targetList[$i];
################# we didn't find a matching record above so let make the record match the new feed data and make a note of the change //
if (!$foundData){
$result = mysql_query("SELECT * FROM ".$targetTable." WHERE ".$primary." LIKE '".$primaryValue."'");
while($row = mysql_fetch_array($result)) {
$fieldName = $targetList[$i];
$oldValue = $row[$fieldName];
}
//MATTHEW'S CODE (MINOR CORRECTION OF MISSING BRACE)
if (!$foundData){
$result = mysql_query("SELECT * FROM ".$targetTable." WHERE ".$primary." LIKE '".$primaryValue."'");
while($row = mysql_fetch_array($result)) {
$fieldName = $targetList[$i];
$oldValue = $row[$fieldName];
echo "<hr><pre>";
echo "i($i)\n";
echo "fieldName($fieldName)\n";
echo "oldValue($oldValue)\n";
echo "targetList...\n";
print_r($targetList);
echo "row...\n";
print_r($row);
echo "</pre><hr>";
}