Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Request #3755 Add Field Type = SET
Submitted: 2005-03-09 09:24 UTC
From: exorion at yandex dot ru Assigned:
Status: Open Package: DB_DataObject_FormBuilder
PHP Version: 4.3.10 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 36 - 14 = ?

 
 [2005-03-09 09:24 UTC] exorion at yandex dot ru
Description: ------------ Hello, i can find a way to make a field type set working like enum, but with multi select type or multi checkboxes type And i was wondering if developers add this to a next version. Expected result: ---------------- Including Set type to a project)

Comments

 [2005-03-09 19:45 UTC] justinpatrin
Hmmm, so a SET type is basically a VARCHAR field with special properties. It has multiple values that can be set. Any # of them can be set, but each one may only be in the set once (this is normal for a set). It's retreived as a comma-delimited string of the selected values and can also be worked on as a # (using bitwise logic). Lots of good info here: http://dev.mysql.com/doc/mysql/en/set.html and here: http://dev.mysql.com/tech-resources/articles/mysql-set-datatype.html I'm not sure whether or not we want to include support for this or not. It 1) is probably not supported on all DBs and 2) promotes non-normalized DBs. It's technically better to use a crossLink to store this kind of data. If we do want to deal with the SET type, it should work just fine with a normal text (VARCHAR) field as Mysql returns SETs as text by default anyway. We would need an additional callback like the enum one and another option like enumOptions. What do other devs think? Is this worth including? I can include it now as we hope to split out the types into a driver system sometime soon anyway... BTW, SET values with commas can be set in the column type by using single quotes, SET('a','b','some,comma') but you can't *set* the column with it unless you use bitwise operations. Also, if you select a record with the value with a comma, it will look like yet another entry: a,some,comma. Apparently Mysql has a deficiency here. It can all be done fine with bit-wise operations, though.