Page 1 of 1

How do I change the delimiter for a group checkbox field?

PostPosted: Tue Sep 13, 2011 7:31 am
by rlevin
One of my fields is a group checkbox. When storing the values of the items checked, it looks like the values in MySQL are being stored with a carriage return as the delimiter. How do I change the delimiter to a comma? The reason why I want to change the delimiter is because I want to query that field using FIND_IN_SET('value2','value1,value2,value3'). I am open to other suggestions too.

Re: How do I change the delimiter for a group checkbox field?

PostPosted: Tue Sep 13, 2011 6:51 pm
by shannah
The delimiter is hard coded I believe. It is also used in other parts of the system to allow performing OR and AND searches on those columns so it isn't advisable to just change it where it is saved.

Why not just do your query like this:
Code: Select all
FIND_IN_SET('str', REPLACE(`col`, '\n', ','))


I suppose it would be optimal for Xataface to just support the SET field type for this sort of thing.... but priorities as they are - and the fact that I've never needed to use the SET type mean that it probably won't happen soon.

-Steve

Re: How do I change the delimiter for a group checkbox field?

PostPosted: Thu Sep 15, 2011 11:00 am
by rlevin
Thanks!