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

Re: Inserting large chunks of data into MySQL

by moritz (Cardinal)
on May 04, 2008 at 15:22 UTC ( [id://684440]=note: print w/replies, xml ) Need Help??


in reply to Inserting large chunks of data into MySQL

You'll get an error if one of these variables contains a single quote '.

To avoid that (and to boost performance) use placeholders instead:

my $sth = $dbh->prepare("INSERT INTO ques(username, userque, ...) VALU +ES (?, ?, ...)"); foreach my $t (split '~', $txtque){ $sth->execute($usernamenow, $t, ...); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-06-25 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.