SELECT * FROM
companies as C
LEFT JOIN usersSearchCache as UC ON C.id = UC.objectId
WHERE UC.userId = ? AND C.keywords LIKE ?
So basically I have an table: usersSearchCache, that has an objectId, the objectId
is linked to the id of the companies table, I need to search where the keywords of the company are matching in the cache of the user.
The query above isn’t working but I don’t understand why.
We got users in a user table, all those users can visit pages of objects, when they visit these pages, a new records is created in the table userSearchCache.
returns something like
Now what I got is a search field, where the users inserts the name of the object they want to search, so the current query is:
to find “biking”, I would use LIKE ‘%BIKING%’
Does your keyword parameter already contain the wildcard characters ‘%’