Skip to content

Laravel using where clause on a withCount method

I am trying to do a where clause on withCount method of laravel’s eloquent query builder using this piece of code. and this code is giving me this error. SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘upvotes_count’ in ‘where clause’ (SQL: select , (select count() from u…

SQL Match individual word?

I am using like statement: %word% but the problem is it also matches words that are inside other words. How can I match words that are separate from the rest in the string like this. I wanna match …