Variable column names using prepared statements

后端 未结 7 643

I was wondering if there was anyway to specify returned column names using prepared statements.

I am using MySQL and Java.

When I try it:

St         


        
相关标签:
7条回答
  • 2020-11-22 08:56

    Prepare a whitelist of allowed column names. Use the 'query' to look up in the whitelist to see if the column name is there. If not, reject the query.

    0 讨论(0)
提交回复
热议问题