Skip to content

Tag: node.js

How i take a value that is like field in my database?

I try to get values that contains words in my sql database. I try with “contains” but I get an error. I work with SQL This is my code: I have this error: UnhandledPromiseRejectionWarning: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL s…

Is escaping SQL queries like this safe?

I am currently working on a NodeJS backend script that parses incoming HTTP requests to write to and read from a MySQL database for work. I tried to protect it against SQL injections by using a kind of two-layer protection. To write to the database the user needs to provide valid JSON. This is how the JSON&#8…