node-db-mysql icon indicating copy to clipboard operation
node-db-mysql copied to clipboard

Allow where clause LIKE variable subtitution for '%?%'

Open tamsler opened this issue 13 years ago • 1 comments

Allow where clause LIKE variable substitution for '%?%'

e.g. db.query().select("contact").from("contacts_t").where("contact LIKE '%?%'", ['foo']).execute(function(error, rows) { ...

Right now, this results in an:

"err":{"message":"Wrong number of values to escape"

tamsler avatar May 06 '12 05:05 tamsler

db.query().select("contact").from("contacts_t").where("contact LIKE ''+db.escape('%'+'foo'+'%')+''').execute(function(error, rows) { ...

tomasikp avatar May 08 '12 01:05 tomasikp