in reply to Re: Quick 'Quote' DBI Question
in thread Quick 'Quote' DBI Question
As a short introduction, placeholders mean you put a question mark anywhere you'd put (quoted or unquoted) input when you prepare() your sql query, and then supply the values when you execute() the query:
Using placeholder guarantees your values will always be "quoted" correctly, regardless of what's in them.my $sth = $dbh->prepare("SELECT something FROM something_else WHERE co +l1 = ? OR col2 = ?"); $sth->execute($value1,$value2); while (my ($result) = $sth->fetchrow) { # do something with $result }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Quick 'Quote' DBI Question
by Trihedralguy (Pilgrim) on Apr 06, 2007 at 14:07 UTC | |
by Joost (Canon) on Apr 06, 2007 at 14:23 UTC | |
by Trihedralguy (Pilgrim) on Apr 06, 2007 at 14:56 UTC | |
by Joost (Canon) on Apr 06, 2007 at 15:02 UTC | |
by Trihedralguy (Pilgrim) on Apr 06, 2007 at 15:05 UTC | |
|