My goal is to create an html select box via a foreach loop that returns all users within a specific custom usergroup (ex. usergroup = Agents).
Once, the query pulls in all records (users) for that specific usergroup, I then need to pull in data from multiple tables for each user, such as: #__users and #__user_profiles – as I’m wanting to grab #__user information such as: name and email, while also grabbing #__user_profile information such as: address1, city, postal_code, etc….
Any help would be appreciate….
Pseudo Code For What I Think I'm Needing
SELECT *
FROM #__users AND #__user_profiles
WHERE #__usergroup.title = Agent
ORDER BY #__users.name ASC;
<select>
FOREACH user that has a #__usergroup.title = Agent
<option>
OUTPUT (
#__users.name,
#__users.email
#__users.usertype,
#__user_profiles.address1,
#__user_profiles.city,
#__user_profiles.postal_code,
#__user_profiles.phone,
#__user_profiles.website
);
</option>
END FOREACH
</select>
users
anduser_profiles
tables (just the CREATE and INSERT queries to build the schema)? Given that sample input, I can craft a direct query to deliver a result set that will be a breeze to iterate. *be sure to obfuscate/redact any private data. – mickmackusa♦ Jan 31 '19 at 13:02