Hello monks. I have some difficulties so i call on you.

So i have at about 100 checkboxes. And every one is different extra for a car ( ABS,ASR,ESP and the list goes on .... until 64 for now, but it will be bigger then 100 ).

So what have i done for now. Every extra abs has decimal number like abs is 1, ASR is 2, ESP is 3 .... This numbers represent the n-th bit of the number of all extras.

explanation if ABS is checked i put 1 only in the field extri on the data base if ABS, ASP are checked i put 3 on my data base. if ABS, ASP, ESP are checked i put 7 on my data base.

so 7 is 0b111? right? And this is my flags for all the extras.

if i have 3 on my field extri then i know (0b11) the first bit and the second one is up then i know that this extras are ABS ASP

Here is the problem

My field extras is big int and it is 64 bits long .... that means i have only 64 extras. so i start to look for solution and i'm thinking for bit var.

but ..... is this the best way to make that?

could you tell me some other solution that is better for the DB, because with this way my searching is so easy just put where clause with

select * from table where (table.extri & b'$extribin_perl')=b'$extribiin_perl'

i do not use any joins

Thank you


In reply to Check boxes by himik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.