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 GROUP_CONCAT to simplify your life - 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 GROUP_CONCAT to simplify your life Print

  • 2

The GROUP_CONCAT function returns a comma separated list of all non-null values that were found in the query.  This is extremely useful when you want to pull a sub-set of related information during within a query, for example:

SELECT `user`.*
, (SELECT GROUP_CONCAT(`usergroup_id`) FROM `usergroup_xref` WHERE `usergroup_xref`.`user_id` = `user`.`id`) AS `usergroup_ids`
FROM `users` AS `user`

In the above example you could retrieve all of the users group ids along with the user row within a single query.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution