Posted by Matt Silberstein on 05/17/06 00:43
On 14 May 2006 03:33:01 -0700, in comp.lang.php , "windandwaves"
<nfrancken@gmail.com> in
<1147602781.523079.191310@j73g2000cwa.googlegroups.com> wrote:
>Hi Folk
>
>I have to store up to eight boolean bits of information about an item
>in my database.
>
>e.g.
>
>[ ] with restaurant
>[ ] drive-through facility
>[ ] yellow windows
>[ ] wifi factilities
>etc...
>
>There are three ways of storing this information in my mysql database
>A. add eight fields (tiny integer)
>B. add one tiny integer and create a function in PHP that can translate
>the number stored into a eight boolean values (the bits)
>C. create a table which list
> ItemID
> Associated characteristics
>In C, you will only list the characteristics that are true for the item
>listed.
>
>Option B is the most efficient in MySql, but would you recommend it
>when creating a PHP website. The problem is that the user needs to
>enter them with a nice webform, etc...
>
>What do you reckon.
>
>TIA
Code is more expensive than storage.
--
Matt Silberstein
Do something today about the Darfur Genocide
http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org
"Darfur: A Genocide We can Stop"
[Back to original message]
|