Variable column names using prepared statements

后端 未结 7 745

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.

提交回复
热议问题