in reply to DBD::mysql bind variables in ORDER BY clause
Thanks for your helpful comments so far. Before I throw up more code, which may or may not help clarify the issue, further experimentation has led me to this (not so profound) discovery.
This:
my $sth = $dbh->prepare("select * from clients order by ? limit 20;"); $sth->execute($dbh->quote_identifier("last_name"));
doesn't actually help after all.
Digging deeper, it appears that I have probably been (mis)using DBI in highly dubious ways:
With most drivers, placeholders can't be used for any element of a statement that would prevent the database server from validating the statement and creating a query execution plan for it.
which, if I understand correctly, includes using ? as a placeholder for a column name.
So I guess I'm screwed.
|
|---|