Jump to content

urgent help please

- - - - -

  • Please log in to reply
No replies to this topic

#1
radio86

radio86

    Newbie

  • Members
  • Pip
  • 1 posts
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




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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users