Binding a wildcard?

14 views
Skip to first unread message

00a5

unread,
Jun 16, 2017, 9:40:33 PM6/16/17
to node-mysql
Hey there,

I've recently started to use `mysqljs` in one of my projects and I'm still getting my head around it.

I have a question about binding: How do you bind a wildcard?

Here's an example:
`SELECT foo FROM bar WHERE bar2 LIKE '%foo2%';`

I thought that binding would go along the lines of:
`SELECT foo FROM bar WHERE bar2 LIKE '%??%';`

Or would it be better to include the wildcard symbols (`%`) as part of the variable been bound?

Thanks!
Reply all
Reply to author
Forward
0 new messages