in reply to drawbacks to 'eval' parameters/placeholders/binding in DBI calls to mysql database
Drawback: ever having a special character in the key name. Heaven forbid you end up with a key name with a single quote in it. (Which then leads to Bobby Tables problems.) Granted, that might cause other SQL problems, but in the general case, it's not unreasonable.
Just push each value into an array, and pass that in. Cheaper, easier to read, easier to maintain, easier to modify (grep, map, whatever), faster, fewer exploits/hard-to-find bugs. There's a reason why we say eval STRING is evil. It's rare that it's the right tool for the job, but it so easily can fit into so many jobs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: drawbacks to 'eval' parameters/placeholders/binding in DBI calls to mysql database
by ikegami (Patriarch) on Aug 20, 2009 at 22:24 UTC | |
by nextguru (Scribe) on Aug 20, 2009 at 22:43 UTC | |
|
Re^2: drawbacks to 'eval' parameters/placeholders/binding in DBI calls to mysql database
by nextguru (Scribe) on Aug 20, 2009 at 22:39 UTC |