[nycphp-talk] Working with multiple records of the same type in LDAP
tedd
tedd at sperling.com
Tue Dec 5 14:57:12 EST 2006
At 2:38 PM -0500 12/5/06, Randal Rust wrote:
>On 12/5/06, tedd <tedd at sperling.com> wrote:
>
>>Your states should be relational.
>
>Do you mean like this...
>
>street[0]=1 W. Test St.
>city[0]=Columbus
>st[0]=OH
>postalCode[0]=43015
>addressType[0]=Business
>
>street[1]=100 High St.
>city[1]=Columbus
>st[1]=OH
>postalCode[1]=43015
>addressType[1]=Business
>
>street[3]=7145 Wilson Bridge Rd.
>city[2]=Columbus
>sta[2]=OH
>postalCode[2]=43017
>adressType[2]=postal
>
>--
>Randal Rust
Randal:
Close, but more like this:
st[0] = Alabama
st[1] = Alaska
st[2] = Arizona
st[3] = Arkansas
st[4] = California
st[..] = ...
where:
street[2]=7145 Wilson Bridge Rd.
city[2]=Columbus
sta[2]=15 (or whatever number Ohio is)
postalCode[2]=43017
adressType[2]=postal
You have a table in your dB that holds all the states, the user
simply picks which state from an option list and the entry in your dB
for that user now points to that state's table as an index instead of
the previous state's index. It's a "one to many" relational dB.
You see, putting the state's name over and over again in the dB is
redundant -- it's better to have a table of states than it is to
repeat data. The same holds true for zip codes and addressType as
shown above.
hth's
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the talk
mailing list