XF 2.1 Search in sv_prefix_ids

Robert9

Well-known member
sv_prefix_ids could be

18 or
18,181,189

I want to search for threads with prefix_id == 18

Can i search for

LIKE 18 OR
LIKE 18,% OR
LIKE %,18,% OR
LIKE %,18

is this correct?
 
If you are using a finder, which you should be, then:

PHP:
$columnName = $finder->columnSqlName('the_column_containg_the_values');
$prefixId = 18;

'FIND_IN_SET(' . $finder->quote($prefixId) . ', '. $columnName . ')'
 
I dont use xf to work here.

LIKE '%18%' is not correct, because it can find also 118,22,23
It is like written, i have to check the cases
 
Back
Top Bottom