How to concatenate two fields from the #__index_users table to show in the dropdown

mauropiro 11 Oct, 2018
Dear Sirs,

How do I concatenate two fields from the #__index_users table to show in the dropdown?

I currently have in the 'fields to retrieve' field Data16.id Data16.username, and in the dropdown it appears
Data16.username
My 'users' table:
How to concatenate  two fields from the #__index_users table to show in the dropdown image 1
My 'fields to retrieve' field
How to concatenate  two fields from the #__index_users table to show in the dropdown image 2
My returned sql
How to concatenate  two fields from the #__index_users table to show in the dropdown image 3
My front end dropdown
How to concatenate  two fields from the #__index_users table to show in the dropdown image 4
The desired front end drop down
How to concatenate  two fields from the #__index_users table to show in the dropdown image 5
Thank you in advance

Mauro
healyhatman 12 Oct, 2018
In fields to retrieve:
CONCAT(model.field , " - " , model.field2):model.alias
or
CONCAT(field , " - " , field2):alias
Pay attention to the spaces between the commas.
mauropiro 12 Oct, 2018
Dear Healyhatman

It worked perfectly, you're awesome,

Thank you.

Mauro
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger