Issue
Can I have a prepared statement with the following query:
select * from table as t order by ? ? limit ?,?
where the second "?" would be asc or desc.
Solution
It is not possible, see here:
Within the statement, “?” characters can be used as parameter markers to indicate where data values are to be bound to the query later when you execute it. The “?” characters should not be enclosed within quotation marks, even if you intend to bind them to string values. Parameter markers can be used only where data values should appear, not for SQL keywords, identifiers, and so forth.
Answered By - Tim Büthe