Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com
Using FIND_IN_SET to filter Multi-Value SQL fields
Print
2
The FIND_IN_SET string function is an amazing little tool that can save you time and headache by allowing you to compare a value against a comma-separated list.
SELECT * FROM `myTable` WHERE FIND_IN_SET('david', `myTable`.`friends`) > 0
The FIND_IN_SET function returns the pointer of the first instance of "david" found in the comma-separated string "friends", and zero if nothing is found.