Recently I wrote about the awesome
group_concat command in MySQL. Well I ran into a little bit of a problem with it. By default the max value is only 1024 characters. I didn’t notice this only I was working with real data and it was showing up truncated in my web app. But luckily there is an environmental variable that can increase the buffer,
group_concat_max_len. If you’re running straight SQL, type:
SET GLOBAL group_concat_max_len = 32000; or whatever size you need.
There are many grid systems out there and not all of them have been created equally. A few coworkers were praising Skeleton so I decided to give it a try for a quick project recently.
I have the unfortunate task for merging two distinctly different channels in ExpressionEngine into a new third channel. If it was only a few entries I would probably do it by hand, but there are hundreds of them. I tried AJW DataGrab, but the matrix field wasn't cooperating. Then I tried Solspace Importer, but the add-on got stuck in an infinite upgrade loop.
So I had to dig deep and write a few MySQL statements and ended up using a couple new commands. My favorite is GROUP_CONCAT, using it I was able to combine several matrix rows into one field. The only problem I had was the standalone query had a GROUP BY clause that worked fine, but when I added it to an UPDATE command I had to remove the GROUP BY in order for it to work. Weird, but not too bad.