I’m very new to erlang and I need to code something which inserts rows in a MySQL Database.
How can I prevent SQL Injections with Erlang? Is there also something like prepared statements in other Languages or how should I do it?
Thanks for your replies.
This answer depends on the driver you are using.
Erlang ODBC has a function param_query that binds a set of parameters to the query and it might also escape all the SQL special characters.
erlang-mysql-driver has prepared statements:
(code from Yariv’s blog)
As a last resort you can always escape the characters