2

In PHP, when extracting bit-flags from MySQL columns/fields, I see (from other SO answers):

UNIQUE_KEY_FLAG = 4
UNIQUE_FLAG = 65536

I'm wondering what the difference is between these two bit-flags?

And why do the lists that I do find show both NUM_FLAG and GROUP_FLAG = 32768?

I'm also wondering why I can't seem to find anything regarding a complete list of field/column bit-flags on either php.net or mysql.com (Oracle). The few lists in SO answers seem to miss bit-flag #8 which is 'MULTIPLE_KEY_FLAG' (I did find one SO answer that did show this) and a couple other entries seem to be lacking as well such as, 4096 and 8192. But in finding a complete list of these bit-flags I'm hoping will reveal a descriptive answer to what each one is... I can only guess my internet searching abilities must be getting old.

Keith DC
  • 661
  • 1
  • 9
  • 24
  • http://dev.mysql.com/doc/refman/5.0/en/c-api-data-structures.html – Marc B Dec 13 '12 at 18:34
  • Appreciate the link. There is a short description of 'UNIQUE_KEY_FLAG' (Field is part of a unique key), but not 'UNIQUE_FLAG', much less a difference between the two. I also don't see anything regarding bit-flags such as 32768 or a bit-flag list. I did eventually find 4096 (NO_DEFAULT_VALUE_FLAG). --Thanks! – Keith DC Dec 14 '12 at 15:42
  • I eventually found bit 4096 on a couple other pages, which is supposed to be "NO_DEFAULT_VALUE_FLAG", but it doesn't seem to work or return anything. As well, 'fetch_field->"def" (which is supposed to be the default value for a given field) doesn't seem to work either, as stated in a comment on: . The lack of information on these fields, especially a field with a default value, is driving me nuts! – Keith DC Dec 16 '12 at 02:44
  • I found a solution for the default column values (detect if post value exists, if not, don't include column in the insert query) . I'd still love to know about my initial 3 questions, and perhaps, why "NO_DEFAULT_VALUE_FLAG" and 'fetch_field->"def" don't work. – Keith DC Dec 16 '12 at 04:03

0 Answers0