Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Deleting Multiple MySQL Rows With DBI

by Odud (Pilgrim)
on May 22, 2001 at 23:42 UTC ( [id://82364]=note: print w/replies, xml ) Need Help??


in reply to Deleting Multiple MySQL Rows With DBI

You should prepare the statement once outside the loop and then bind and execute it inside the loop
my $sth = $dbh->prepare("DELETE * FROM table WHERE message_id = ?"); while $i (@MESSAGE_IDS){ $sth->bind($i) $sth->execute(); # and so on ... }
Check the perldoc for DBI - this is off the top of my head.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://82364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-28 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found