How can I protect against SQL injection attacks using Perl's DBI?

后端 未结 5 1158
野趣味
野趣味 2020-12-08 07:04

Is there a function i can use in Perl to sanitize input before putting it into a MySQL db? I don\'t know regex very well so before I make my own function i was wondering if

5条回答
  •  萌比男神i
    2020-12-08 07:14

    Answer: Use SQL placeholders (?).

    Why: The structure of the SQL statement and the data values represented by the placeholders are sent to the database completely separately. so there is absolutely no way that the data values can be interpreted as SQL commands.

提交回复
热议问题