hi there,

i am trying to find duplicate records e.g. where id =1,2,3,4
if id =1,2,3 were found and not the 4th...how do i get non found value so i could used to store in the table e.g.

here is my code pleas help me


Code:

the payments table is like this
:

cID transactionID
1    950
1    123

in the duplicates table i have manually entered the information

ID CID TranscationID
1   1    950



transcationID are in 
array e.g. ('950','123')

$pquery ="Select `transcationID` from payments where cID = $cID";

  
$payments=(mysql_query($pquery)) or die("Error payments" mysql_error());

while(
$row mysql_fetch_array($payments))
  {
  
$data[] = $row['transcationID'];
  }

  
$q="Select * from duplicates where transcationID IN ('" join("','",$data) . "')";
  echo
"Select * from duplicates where transcationID IN ('" join("','",$data) . "')";
  
  if(!
$res=mysql_fetch_array(mysql_query($q)))
  {
      
$m "YES";
      echo 
"$m";
  }
  else  
//if there is no duplicate found then store that transcation id

{
      
$tid=$res['transcationID']; // here it stores the duplicate 950 but not the non-duplicate...i want to store the non-duplicate id
      
$m "NO";
      echo 
"$m";
      echo 
"ID is $tid";
  } 
i am storing the non matched transaction id into a table for future duplicate matches or to update duplicate transactions

please help me, its urgent