[ILUG] Perl / MySQL oddity
Niall
niall at magicgoeshere.com
Tue Apr 25 15:01:24 IST 2000
On Tue, Apr 25, 2000 at 11:27:30AM +0100, Nick Hilliard wrote:
> On a stylistic point, the recommended way to do this sort of thing is:
>
> $sth = $dbh->prepare("INSERT INTO $table $Fields VALUES (?,?,?,?,?,?,?)");
> $sth->execute( $Description, substr($Description, 0, 50),
> $2, $Keywords, $UnixPath, $MacPath, $Volume);
I tried using this syntax at some stage but had some kind of problem with it
and didn't keep trying. However,
> This gets around the need to mess around with quoting things all over the
> place.
I'm not sure that this is right. DBI->quote is to quote strings being passed
to the server. I don't see how passing them via these bound parameters
gets around this necessity.
Regards,
Niall
More information about the ILUG
mailing list