Array
(
    [0] => Warning
    [1] => Undefined array key "language"
    [2] => /home/whmcsdev/public_repo/wbteampro.major-release/installation/modules/addons/wbteampro/initialize.php
    [3] => 282
)
Array
(
    [0] => Warning
    [1] => Undefined property: stdClass::$state
    [2] => /home/whmcsdev/public_repo/wbavatax.master/installation/modules/addons/wbavatax/hooks.php
    [3] => 942
)
Array
(
    [0] => Deprecated
    [1] => htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated
    [2] => /home/whmcsdev/public_repo/wbavatax.master/installation/modules/addons/wbavatax/hooks.php
    [3] => 279
)
Using FIND_IN_SET to filter Multi-Value SQL fields - Knowledgebase - WHMCS Dev
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.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution