|
Posted by J.O. Aho on 06/20/06 01:35
Frankly wrote:
> "J.O. Aho" <user@example.net> wrote in message
>>> the realy tricky one for me is how can i disply where i posted to.
>>> can i have something like 4 check boxes each box representing a different
>>> website?
>> Yes, you can do that and this can be done in quite many ways, the usual 4
>> fields where you store 0 (not posted here) or 1 (posted on the website).
>> You can also use one filed and use a binary way of thinking, one website
>> is 1, next one is 2, third is 4 and the last is 8, 0 is the same as it's
>> not posted at any of the websites, if the value is 5, then the site has
>> been posted at website 1 and 3, but not at 2 and 4. This has the drawback
>> that you need more PHP code to check up which sites has been posted at.
>
> i take it that you like the binary way better. in doing this i would have
> to watch out for values that can have different combos like your not making
> the 3rd 3. when someone is helping me i usually go the way they think is
> best. I am wondering how much extra code will be needed and if using the
> number system will be more confusing for my wife and allow for more errors.
> having a feild for each site does seem easier but you have the ability to
> see down the road.
I'm really not sure, I do like the idea of the binary way, but having
different columns is the easy way around, of course you need to add more
columns if you increase the number of places where to post. With the columns
it's easier to search for sites that has been posted at one specific site
SELECT * FROM table WHERE site1column=1;
while withe the binary system you would need to make
SELECT * FROM table where stiescolumn IN(1,3,5,7,9,11,13,15);
> i find it odd that the Administrator does not have a print function to print
> out my table structure.
It can be quite a lot of data in a database, say you have 100000 rows, then
you could end up with a really big print. It's not meant to be used by normal
users to check things, for that you usually have a front end.
//Aho
[Back to original message]
|