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

Re^3: Database Insert Depending on Data Type

by jZed (Prior)
on Dec 20, 2007 at 21:12 UTC ( #658262=note: print w/replies, xml ) Need Help??


in reply to Re^2: Database Insert Depending on Data Type
in thread Database Insert Depending on Data Type

It looks like you are not using the same variables in the SQL that you used the quote() method on. I really advise you to use placeholders instead. Something like:
my $sqlCmd = $dbh->prepare(" UPDATE $table SET $column = ? WHERE $column = ? "); for ($count = 0; $count < $EasySetDataCount; $count++) { $sqlCmd->execute( $NewEasySetDataNames[$count], $EasySetDataNames[$count], ); }
The placeholders mean you don't need to worry about quoting at all, you just say where the value should go (with the question marks in the SQL) and what data should be placed in those places (the items in the call to execute).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://658262]
help
Chatterbox?
[Discipulus]: Eataly: average 8years and 7months for all 3 degrees of judgement..

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-11-20 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (286 votes). Check out past polls.

    Notices?