Orit Active member Aug 2, 2023 #1 Hi, I can't manage to get the finder to fetch this query: SELECT * from xf_table where xf_table.title LIKE '%test%' $formFinder->where('title', 'LIKE', $title) does not get the requested results. Thanks!
Hi, I can't manage to get the finder to fetch this query: SELECT * from xf_table where xf_table.title LIKE '%test%' $formFinder->where('title', 'LIKE', $title) does not get the requested results. Thanks!
Orit Active member Aug 2, 2023 #2 Well, of course it should simply be: $formFinder->where('title', 'LIKE', '%'.$title.'%');
Chris D XenForo developer Staff member Aug 2, 2023 #3 Kind of. This is the approach we take elsewhere in XF: PHP: $formFinder->where('title', 'like', $formFinder->escapeLike($title, '%?%')) This will ensure the $title input is escaped correctly.
Kind of. This is the approach we take elsewhere in XF: PHP: $formFinder->where('title', 'like', $formFinder->escapeLike($title, '%?%')) This will ensure the $title input is escaped correctly.