Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone
Are there differences between the following two ways of inserting MySQL data?# 1a $dbh->do(qq~INSERT INTO scores VALUES($userid, $score, NOW())~); #1b $dbh->do(qq~INSERT INTO scores VALUES(?, ?, NOW())~, undef, $userid, $ +score); #2a $dbh->do(qq~UPDATE scores SET score=? WHERE userid=?)~, undef, $new_sc +ore, $userid); #2b $dbh->do(qq~UPDATE scores SET score=$new_score WHERE userid=$userid)~) +;
Is one method preferrable to the other?
TIA :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Quick DBI do question
by kennethk (Abbot) on Feb 13, 2009 at 16:00 UTC | |
by lostjimmy (Chaplain) on Feb 13, 2009 at 16:17 UTC | |
by kennethk (Abbot) on Feb 13, 2009 at 16:21 UTC | |
by doom (Deacon) on Feb 15, 2009 at 03:23 UTC | |
by Anonymous Monk on Feb 17, 2009 at 13:16 UTC | |
by kennethk (Abbot) on Feb 17, 2009 at 14:27 UTC | |
by Anonymous Monk on Feb 17, 2009 at 16:03 UTC | |
Re: Quick DBI do question
by ForgotPasswordAgain (Priest) on Feb 13, 2009 at 15:56 UTC | |
Re: Quick DBI do question
by Anonymous Monk on Feb 14, 2009 at 01:16 UTC |
Back to
Seekers of Perl Wisdom