[Solved] PHP – How to format data for in_array


Use FIND_IN_SET() to search for an element of a comma-separated list.

$lsc_adminid_query = xtDBquery("
    SELECT lsc.option_id
    FROM lsc_config lsc
    WHERE FIND_IN_SET({$_SESSION['customer_id']}, lsc.option_value)");

But it would be better to normalize your design so you don’t have comma-separated lists in database columns in the first place.

3

solved PHP – How to format data for in_array