We have a 3rd party component and in the database there is a column clled options which contains the users gender - COM_COMMUNITY_MALE and COM_COMMUNITY_FEMALE. When we read this information in using this code
$SQL = "SELECT * FROM #__community_fields a WHERE a.fieldcode like 'FIELD_GENDER%'";
$db->setQuery($SQL);
$rows = $db->loadObjectList();
$html = "<option value =' '>Select Gender</option>";
foreach ($rows as $data)
{
$xxx = explode("\n", $data->options);
for ($i = 0; $i < count($xxx); ++$i) {
if ($xxx[$i] == "COM_COMMUNITY_MALE")
{
print $xxx[$i];
}
}
$html = $html . "<option value ='".$arr."'>".$gender."</option>";
}
echo $html;
The check for $xxx[$i] == "COM_COMMUNITY_MALE" does not print the value. If we just print $xxx[$i] then we do see the correct values but when we do the check if fails the test
We need to distinguish the gender so we can ste the values in the dropdown
Any help would really be appreciated
Thanks Rich