unxposed Posted October 27, 2010 Share Posted October 27, 2010 I have a query where I have a concat nested inside a group concat. The problem I'm having is that the last x amount characters are being cut from the result. for example below at the end of the position column instead of finishing 'Position unknown' it finsihes 'Position'? GROUP_CONCAT( DISTINCT CONCAT( people.name, ' - ', IFNULL(members.position, 'Position unknown') ) SEPARATOR '~' ) AS position Thanks Quote Link to comment https://forums.phpfreaks.com/topic/217023-end-characters-of-group_concat-being-cut/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 27, 2010 Share Posted October 27, 2010 If it always cuts off at some white-space, it is likely that your HTML is invalid. What is your code that is displaying the results? Quote Link to comment https://forums.phpfreaks.com/topic/217023-end-characters-of-group_concat-being-cut/#findComment-1127177 Share on other sites More sharing options...
unxposed Posted October 27, 2010 Author Share Posted October 27, 2010 Hi, Thanks for the reply. I'm actually doing this directly in phpmyadmin so definately a sql issue. Here's the exact code: SELECT parties.id, GROUP_CONCAT(DISTINCT CONCAT(people_lang.name, ' - ', IFNULL(members_lang.position, 'Position unknown')) SEPARATOR '~') AS position FROM parties LEFT JOIN members ON parties.id = members.party LEFT JOIN members_lang ON members.id = members_lang.member AND members_lang.il8n = 1 LEFT JOIN people_lang ON members.person = people_lang.person AND people_lang.il8n = 1 And the result: Hla Myint Oo - Position unknown~Htay Win - Position unknown~Maung Oo - Position unknown~Thura Shwe Mann - Position unknown~Thiha thura Tin Aung Myint Oo - Position unknown~Khoo Francis Ko - candidate~Soe Maw Ye - Position unknown~Shwe Nan - Position unknown~Saw Htay - Position unknown~Kyaw Aye - Position unknown~Moe Myint Thein - Position unknown~San Htun - Position unknown~Maung Maung Oo - Position unknown~Win Myint Dr USDP - Position unknown~Soe Aung - Position unknown~Htay Maung - Position unknown~Khin Maung Htay 2 - Position unknown~Mat Gyi USDP - Position unknown~Tin Kha - Position unknown~Nu USDP - Position unknown~Tin Yu - Position unknown~Shwe Aung USDP - Position unknown~Nyunt Tin - Position unknown~Maung Thin Dr - Position unknown~Zin Nyunt - Position unknown~Win Naung - Position unknown~Myo Thant Tin Dr - Position unknown~Mya Nyein - Position unknown~Myint Kyi Dr - Position unknown~Khin Shwe Dr - Position unknown~Aye Maut - Position unknown~Than Soe - Position unknown~Thein Aung USDP - Position unk Thanks Quote Link to comment https://forums.phpfreaks.com/topic/217023-end-characters-of-group_concat-being-cut/#findComment-1127192 Share on other sites More sharing options...
mikosiko Posted October 27, 2010 Share Posted October 27, 2010 group_concat_max_len reached. (default is 1024 bytes) http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_group_concat_max_len Quote Link to comment https://forums.phpfreaks.com/topic/217023-end-characters-of-group_concat-being-cut/#findComment-1127194 Share on other sites More sharing options...
unxposed Posted October 27, 2010 Author Share Posted October 27, 2010 Ahhh, of course! Thanks v. much! : ) Quote Link to comment https://forums.phpfreaks.com/topic/217023-end-characters-of-group_concat-being-cut/#findComment-1127203 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.