I want to find the “id” of each row in my sql table column “teams” = “11”
However, “teams” is stored in this format:
1,2,3,4,5,11,20
1
1,3,4
11,34
I have tried using the “in” query, but will not work.
$query = "SELECT u_id FROM #__bl_teamcord WHERE (11 IN (teams))";
$db->setQuery($query);
$remail = $db->loadObjectList();
You can use:
However, if these tables have a lot of data or performance is critical, you might want to consider normalizing your data into a separate table rather than using a comma delimited list in each row.