Skip to content
Advertisement

What is the correct syntax for replacements within a SQL string

I am attempting to do a basic search in my sqlite3 database with this JavaScript:

This works but is vulnerable to SQL injection. I am trying to get the sqlite replacements parameter to work but I cannot get the syntax right. Sqlite doesn’t want to replace anything within the string literal.

What is the correct way to write this so that it’s not vulernable to SQL injection?

Advertisement

Answer

I figured it out

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement