Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:17:21+00:00 2026-06-15T13:17:21+00:00

I am creating a user profile plugin in Joomla 2.5 to extend the standard

  • 0

I am creating a user profile plugin in Joomla 2.5 to extend the standard user fields.

The issue is I need an efficient way to retrieve the users (along with the extra fields) via a MySQL query. Currently the best method I can think of is querying the #__user_profiles table and processing that data to determine the extra fields to load and then producing a query that creates a separate join on the #__user_profiles table for each extra user field.

Obviously that isn’t very efficient and on a large user base the query is quite slow.

Is there a better way to combine extra user fields that are separate records in another table into one query?

EDIT:

I have an external script that needs to grab all the users and their extended fields so I need to combine the #_users and #_user_profiles tables

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:17:22+00:00Added an answer on June 15, 2026 at 1:17 pm

    In the end I decided to go for a pivot table approach

    example:

    SELECT
        #__users.*,
        MAX(CASE WHEN profile_key = "example.firstname" THEN profile_value END) AS FirstName,
        MAX(CASE WHEN profile_key = "example.lastname" THEN profile_value END) AS LastName,
        MAX(CASE WHEN profile_key = "example.company" THEN profile_value END) AS Company
    FROM #__users LEFT JOIN #__user_profiles ON #__users.id = #__user_profiles.user_id
    GROUP BY #__users.id
    

    This allows me to have all the extra user data in one row so I can easily order and filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help on creating a user profile system. I want it to
I'm creating a custom profile page and I need the user to be able
I'm creating a site with users, and users will have various profile fields. I
I'm creating a user profile for my website and I need to allow user
I'm creating some user profile edit forms in MVC4 at the moment and for
I have the following requirement for creating a user profile in my application: User
I'm creating an edit user profile for my project. I came across this error
I am looking for some suggestions for creating a User Profile System . I
Is there an easy way to allow for required profile fields? I am using
I'm creating a user profile class for my new django website, and I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.