in reply to single error with a dbh prepare
Check your quotes. You are using double quotes within a double-quoted string - and that's never going to work. I recommend switching to qq().
Also, you need to use the concaternation operator and more quotes to include the parameter value in the string.
Oh. And your order clause isn't right.
$sth = $dbh->prepare(qq( SELECT * FROM $pictures_table WHERE stats="2" AND poster_name = ') . param('name') . qq(' ORDER BY poster_name ASC));
Actually, it might be easier to use a placeholder to insert the parameter. That way you don't need to worry about the quoting.
$sth = $dbh->prepare(qq( SELECT * FROM $pictures_table WHERE stats="2" AND poster_name = ? ORDER BY poster_name ASC)); $sth->execute(param('name'));
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: single error with a dbh prepare
by davidrw (Prior) on May 17, 2006 at 15:27 UTC | |
by Happy-the-monk (Canon) on May 18, 2006 at 12:13 UTC |