Jenda Krynicky wrote:
From: "Pat Rice" <[EMAIL PROTECTED]>
my $sth = $dbh->prepare('SELECT * FROM test1 ORDER BY ?');
Most databases would not let you prepare a statement like this. Most
often only values may be replaced by placeholders, not column names.
Hmm.. My fault, obviously. I had no idea.
So, what you are saying is that
my $sth = $dbh->prepare('SELECT * FROM test1 ORDER BY ?');
$sth->execute($sortby);
should better be replaced by
my $sth = $dbh->prepare("SELECT * FROM test1 ORDER BY $sortby");
$sth->execute();
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/