View Single Post
  #7 (permalink)  
Old 09-02-03, 10:54 AM
ChristGuy ChristGuy is offline
Operations Support Develo
 
Join Date: Jun 2003
Location: Rivonia, South Africa
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Greetingz...

Thanx for the PDF...

Because MySQL < 4.1 can't do Sub Selects We'll haveto try something different...
(This hasn't been tersted but should work)
PHP Code:

  $dbConn MySQL_Connect"localhost""root""" ) or

    Die( 
"Error connecting to MySQL: " MySQL_Error() );

  
MySQL_Select_DB"aci" ) or
    Die( 
"Error selecting Database: " MySQL_Error() );

  
$sSQL "SELECT DISTINCT clientID, targetEmail FROM target";  //  Select Unique values

  
$resUnique MySQL_Query$sSQL ) or
    Die( 
"Error executing query: " MySQL_Error() );

  while ( 
$row MySQL_Fetch_Array$recUnique ) )
  {
    
$sSQL "SELECT * FROM target WHERE clientID=" $row["clientID"] . " AND targetEmail=" $row["targetEmail"];

    
$recDuplicate MySQL_Query$sSQL ) or
      Die( 
"Error executing query: " MySQL_Error() );

    while ( 
$duplicates MySQL_Fetch_Array$recDuplicate ) )
    {
      print( 
"Duplicate found: " $duplicates["clientID"] . "<BR>\n" );
    }

    
MySQL_Free_Result$recDuplicate );
  }

  
MySQL_Free_Result$recUnique );
  
MySQL_Close$dbConn ); 
Like I said I havn't tested the above... But I'm quite sure it will work as is...
__________________
Till We Meet Again...
Clifford W. Hansen
Aspivia (Pty) Ltd

"We Have Seen Strange Things Today!" Luke 5:26
Reply With Quote