×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Multiple database columns in drop down box
Ryan Minnig
Yeni Üye
Posts: 10
3 yıl 2 hafta önce #9916
Yazan: Ryan Minnig
Multiple database columns in drop down box, Ryan Minnig tarafından oluşturuldu
I'm creating a component with a subform in which I want to have a drop down box that is populated with results from an SQL querry. I have chosen both the 'SQL field' and 'SQL field with extended settings' in an attempt to do this. With the more simple option I can successfully have the drop down box populated with the 'first_name' column OR the 'last_name' column but I would really like to concatenate these 2 columns into 'first_name' + ' ' + 'last_name'.
I have tried multiple combinations of SQL statements in 'SQL field' such as:
SELECT 'first_name', 'last_name' FROM #__test_people
the key field is 'id' and the value field is CONCAT(first_name, ' ', last_name)
I have also tried SELECT 'first_name', 'last_name', CONCAT(first_name, ' ', last_name) as full_name FROM #__test_people
the key field is 'id' and the value field is 'full_name'
any suggestions on how to concatenate these 2 columns using either the regular SQL field or extended options?
I have tried multiple combinations of SQL statements in 'SQL field' such as:
SELECT 'first_name', 'last_name' FROM #__test_people
the key field is 'id' and the value field is CONCAT(first_name, ' ', last_name)
I have also tried SELECT 'first_name', 'last_name', CONCAT(first_name, ' ', last_name) as full_name FROM #__test_people
the key field is 'id' and the value field is 'full_name'
any suggestions on how to concatenate these 2 columns using either the regular SQL field or extended options?
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Pete
Bakır Üye
Posts: 27
2 yıl 11 ay önce #9931
Yazan: Pete
Pete tarafından Multiple database columns in drop down box konusunda yanıtlandı
I tried the same and got an error as well.
select prefix, CONCAT(prefix,' ') as name from #__eb_coupon
Works for me.
However a BUG - in a list thsi field do not show what has been selected, but just one value.
select prefix, CONCAT(prefix,' ') as name from #__eb_coupon
Works for me.
However a BUG - in a list thsi field do not show what has been selected, but just one value.
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Sayfa oluşturma süresi: 0.052 saniye