|
Posted by Tim Van Wassenhove on 05/14/06 19:15
On 2006-05-14, windandwaves <nfrancken@gmail.com> wrote:
> There are three ways of storing this information in my mysql database
> A. add eight fields (tiny integer)
If those eight fields are 'properties' that belong to each item, then
this seems like a good approach.
> B. add one tiny integer and create a function in PHP that can translate
> the number stored into a eight boolean values (the bits)
I don't believe in such 'fields'. They only 'seem' to be the most
efficient, but only when there are as much possible options as there are
bits. (Eg: 9 options would require 2 x 8 bits (and 7 are left unused))
Anyway, mysql seems to have special 'field' functions these days, check
out the manual ;)
> C. create a table which list
> ItemID
> Associated characteristics
This seems like the right approach for n-m relationships.
> Option B is the most efficient in MySql.
Define efficient.
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
Navigation:
[Reply to this message]
|