View Single Post
Old 02-19-2013, 07:35 PM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Well, like I said. Write your own code to do this. It's trivial. I don't use PHP, but it will be something as simple as this:
Code:
<form action="myDelete.php" method="post">
<table border="1" cellpadding="3">
<tr>
    <th>DELETE</th><th>Lnktxt</th><th>Cattxt</th><th>Dsptxt</th>
</tr>
<?php
... make your db connection ...
$sql = "SELECT P1.uniqueid, P1.lnktxt, P1.cattxt, P1.dsptxt
        FROM TABLE AS P1,
        ( SELECT lnktxt, cattxt, dsptxt, COUNT(*) AS howmany
          FROM TABLE
          GROUP BY lnktxt, cattxt, dsptxt
          HAVING howmany > 1 ) AS P2
        WHERE P1.lnktxt = P2.lnktxt AND P1.cattxt = P2.cattxt AND P1.dsptxt = P2.dsptxt
        ORDER BY lnktxt, cattxt, dsptxt ";

$result = mysql_query($sql);

while ( row = mysql_fetch_assoc($result) )
{
    $id = row["uniqueid"];
    echo '<tr><td><input type="checkbox" name="delete[]" value="' .$id . '" />' . $id . "</td>\n";
    echo "<td>...the other fields...</td></tr>\n";
}
?>
</table>
<input type="submit" value="delete checked rows">
</form>
Now, as I said, I don't use PHP, but I *THINK* your "myDelete.php" page would be as simple as this:
Code:
<?php
...make db connection ...
$sql = "DELETE FROM TABLE 
        WHERE uniqueid IN (" . implode(",",$_POST["delete"]) . ")";
mysql_query($sql);
?>
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote