in reply to Re^2: Storing multiple value field in a MySQL database
in thread Storing multiple value field in a MySQL database
Why?
davido has illustrated the general layout of the tables for the normal solution. An alternative would be:
Table1: userid email age memberof john john@example.com 45 admins john john@example.com 45 wizzards jerry jerry@example.com 22 newbies jerry jerry@example.com 22 trainees jerry jerry@example.com 22 newhires
which is obviously dumb because of all the repeated information and the slightly more subtle problem that if jerry's age changes (age does tend to change) you have to fix every 'jerry' row. Or maybe you mean something like:
Table1: userid email age memberof john john@example.com 45 admins!wizzards jerry jerry@example.com 22 newbies!trainees!newhires
but then there is no efficient way to search for all newhires.
So, again, why? What is it about davido's solution that you don't like or can't understand?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Storing multiple value field in a MySQL database
by mba777 (Novice) on Nov 25, 2013 at 20:02 UTC | |
by GrandFather (Saint) on Nov 25, 2013 at 20:51 UTC |