On my website, for members of my service I provide a contact database where they can store all their contacts. This database is suppose to be more tailored fit for the member. When entering a contact it asks all the standard questions like names and titles, then stores them in table contacts
. Then come the additional fields like phone, address, email, and website. But contacts can multiples of those, so I want my members to be able to enter unlimited. I did this by making a table for each field, contacts_phone, contacts_address, contacts_email, contacts_website
and each row had the id, parent, and data.
This made it extremely hard for me to get a proper search going. The only way these extra fields are connected is through parent
which holds the ID of the contact it is connected to.
It also cause some other bugs and errors so I decided to trash that idea and considered it a failure.
Now I've decided to limit the member on entering up to 10 multiples of each field. So in table contacts
it now has hundreds of columns (phone_1_data, photo_2_data, phone_3_data, ect.) and just seems messy and wrong. It will be so much easier to search through, sort, and interact with but it doesn't seem like the best way.