node.js - why mysql.escape will parse 'hello' to '\'hello\'' -


i escape parameter @ first , concat sql string when querying. when concat query strings using like:

const name = mysql.escape(req.info.name) const sqlstring = `select...name '%${name}%'` 

it lead select ... name '%'hello'%', want select ... name '%hello%'

image

enter image description here


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -