Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Deleting Multiple MySQL Rows With DBI

by Odud (Pilgrim)
on May 22, 2001 at 23:42 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2023-01-30 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?