in reply to Where the advice to use DBI bind parameters can go wrong (long)
$sth->prepare(qq{ SELECT name, url FROM table WHERE name LIKE %$name%});
This may not do what you expect:
$sth->prepare("SELECT * FROM companies WHERE name = ?");
I've been burned by the double-quotes in '$sth->prepare' also, so I have refrained from using them, especially with regard to their use with binds. In fact, your second example will not work with those bind parameters in double-quotes. All of the DBI books I've seen refer to qq// in these circumstances.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Where the advice to use DBI bind parameters can go wrong (long)
by rdfield (Priest) on Jun 27, 2002 at 08:23 UTC |