471,075 Members | 815 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Storing single bits efficiently

mrT
Hi,
My latest web project includes loads of user-customisable features,
lots of which are on/off values. Currently I'm storing each one of the
15 or so properties in tinyint fields, as 1s or 0s. There must be a
smarter way...

I know it's possible to store a set of 8 bits in a tinyint column, but
the work involved in retrieving, and (more importantly) updating the
flags is off-putting. I had a look at the set field type, but can't
find any mysql functions for updating sets - I want to be able to
change specific bits in a set without having to retrieve the set
first.

What do the pros do? Any help is appreciated.

TIA!
Thomas
Jul 19 '05 #1
0 1057

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mark | last post: by
reply views Thread by mrT | last post: by
15 posts views Thread by Tor Erik Sønvisen | last post: by
14 posts views Thread by Luiz Antonio Gomes Pican?o | last post: by
14 posts views Thread by vib | last post: by
6 posts views Thread by Kyle Teague | last post: by
11 posts views Thread by Mack | last post: by
11 posts views Thread by spasmous | last post: by
5 posts views Thread by Neel | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.