1

I'm a beginner in PHP and MySQL. Using this query information how can I add code to find duplicate people using only Phone Number and First name, middle initial and last name.

$query = "SELECT id, first_name, last_name, mi, organization, ";  
$query.= "primary_email, second_email, primary_phone, ";  
$query.= "address1, address2, city, state_province, zip, ";  
$query.= "last_login ";  
$query.= "FROM member_tbl WHERE id < 1000"; // *change to "WHERE status   = 'ACTIVE'" -- but that causes a fatal memory error*  

$stmt = $pdo->prepare($query);  
$stmt->execute();    


$mbrTbl = $stmt->fetchAll(PDO::FETCH_ASSOC);  
for($i=0; $i<$stmt->rowCount(); $i++) {  
    *// Gather all the info for one member*  
    $fName1 = strtolower($mbrTbl[$i]['first_name']);  
    $lName1 = strtolower($mbrTbl[$i]['last_name']);  
    $mName1 = strtolower($mbrTbl[$i]['mi']);  
    $phone1 = $mbrTbl[$i]['primary_phone'];  
    $org1 = strtolower($mbrTbl[$i]['organization']);  
    $primEmail1 = strtolower($mbrTbl[$i]['primary_email']);  
    $scndEmail1 = strtolower($mbrTbl[$i]['second_email']);  
    $phone1 = $mbrTbl[$i]['primary_phone'];  
    $address11 = strtolower($mbrTbl[$i]['address1']);  
    $address21 = strtolower($mbrTbl[$i]['address2']);  
    $city1 = strtolower($mbrTbl[$i]['city']);  
    $state1 = strtolower($mbrTbl[$i]['state_province']);  
    $zip1 = $mbrTbl[$i]['zip'];  
}  
print_r($mbrTbl);  
CJones
  • 17
  • 2
  • Possible Duplicate of https://stackoverflow.com/questions/854128/find-duplicate-records-in-mysql – LuFFy Jun 27 '17 at 13:07

0 Answers0