bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
I have found gmax's DBI recipes helpful many times over, but I'm trying to lock down security and use placeholders. I'm able to do this in all of his examples but my rendition of:
my $query2 = qq{select id, name, salary from employees}; my $employees_loh = $dbh->selectall_arrayref($query2, {Slice => {}});
I need to add a where condition with a user input parameter:
$employer = $query->param('employer'); my $query2 = qq{ select id, name, salary from employees where employer + = ? }; my $employees_loh = $dbh->selectall_arrayref($query2, {Slice => {}});
Where do I insert the variable name, $employer, in my selectall_ line? Or is it even necessary? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using placeholders in selectall_arrayref
by Fang (Pilgrim) on Jan 11, 2006 at 13:01 UTC | |
by Happy-the-monk (Canon) on Jan 11, 2006 at 13:30 UTC | |
by bradcathey (Prior) on Jan 11, 2006 at 13:48 UTC | |
by vagabonding electron (Curate) on Jun 03, 2012 at 13:18 UTC | |
|
Re: Using placeholders in selectall_arrayref
by bravenmd (Sexton) on Jan 11, 2006 at 21:08 UTC |