Skip to content
Advertisement

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 server version for the right syntax to use near ‘(title, ‘a’)’ at line 1

Advertisement

Answer

You can use LIKE operator :

if you are more than one word use and or or operator

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