Menu

#393 Duplicate search

closed
nobody
5
2008-08-27
2008-01-24
Tsynique
No

Hello, I once needed a duplicate search on my database so I added this script to automate the process. I figured maybe it could be added. I used the link below a field name when browsing.

//// Duplicate search URL

if ($analyzed_sql[0]['group_by_clause'] && $analyzed_sql[0]['having_clause']) {
$dup_url = "";
} else {
$dup_field = PMA_backquote($fields_meta[$i]->name);
$dup_table = PMA_backquote($table);
$dup_query = "SELECT ". $dup_field .", COUNT(*) AS n FROM ". $dup_table ." GROUP BY ". $dup_field ." HAVING n > 1";

$dup_url = 'sql.php?' . PMA_generate_common_url($db, $table) .'&sql_query='. urlencode($dup_query);
}

........

if ($dup_url != "") {
$dup_link = PMA_linkOrButton($dup_url, "<font size='1'>(Find duplicates)</font>", "", false, false);
}

........

if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
echo ' valign="bottom"';
}
echo '>' . $order_link . $dup_link. $comments . </th>';

/// End

Discussion

  • Tsynique

    Tsynique - 2008-01-24

    Logged In: YES
    user_id=1547980
    Originator: YES

    CORRECTION:

    $dup_link = PMA_linkOrButton($dup_url, "<br><font size='1'>(Find
    duplicates)</font>", "", false, false);

     
  • Marc Delisle

    Marc Delisle - 2008-01-25

    Logged In: YES
    user_id=210714
    Originator: NO

    Nice idea but I would not clutter the normal Browse page with this. Better to put it on the table Search page (maybe in another dialog under the main one). Please have a look at current trunk for 3.0-dev and suggest something (or attach a patch :) ).

     
  • Marc Delisle

    Marc Delisle - 2008-01-29

    Logged In: YES
    user_id=210714
    Originator: NO

    Any feedback about my proposal?

     
  • Tsynique

    Tsynique - 2008-01-29

    Logged In: YES
    user_id=1547980
    Originator: YES

    Yes, I've been away for a while. I will do this by today or tommorow.

     
  • Tsynique

    Tsynique - 2008-01-30

    Logged In: YES
    user_id=1547980
    Originator: YES

    Ok, so I will make the duplicate search table below the "Select fields (at least one):" table. Would that be ok?

     
  • Marc Delisle

    Marc Delisle - 2008-01-30

    Logged In: YES
    user_id=210714
    Originator: NO

    Yes. I was wondering what's the best: show all fields with radio boxes or in a drop-down (with the possibility of selecting just one field).

    Another possibility: the "Select fields" dialog could be replaced by checkboxes in the Query by example dialog and this would take care of the field selection part. Then the new dialog for duplicates would be at the bottom.

     
  • Marc Delisle

    Marc Delisle - 2008-08-12
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.