This topic is locked
[SOLVED]

 Foreign key vs. Master details vs. Lookup wizard

12/6/2016 7:40:07 AM
PHPRunner General questions
K
Khampol author

Hi there,

I am totally beginner in php and mysql.... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=24347&image=1&table=forumtopics' class='bbc_emoticon' alt=':wub:' />
I build my db with some tables link between them self by foreign keys, with phprunner i find that i dont need to do that as i use the lookup wizard (i dont even have to use the master details relationship)... its very easy... "too" easy... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=24347&image=2&table=forumtopics' class='bbc_emoticon' alt=':unsure:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=24347&image=3&table=forumtopics' class='bbc_emoticon' alt=':unsure:' />
eg :
table 1

-id

-employee

-gender
table 2

-id

-gender
I set the lookup wizard for table 1 -gender to look on -id table 2 and now i have the gender of the employee.... No need Foreign key, no need Master details ...

Is this correct ?

A
andreas.knab 12/6/2016

Hi Khampol,
yes for lookup tables you don't need any relationship. The lookup table just gives you some values to select into a field.
In case of Gender I would prefer the Option "list of values" and the fill in "male" "female".

So you don't need a seperate lookup table for this.
If you want to be politically correct an have many genders ( like here : https://ageofshitlords.com/list-of-all-tumblr-genders-so-far/ )

Or e.g. you have a list of departments ....a lookup could make sense.
CU

Andreas

K
Khampol author 12/6/2016



Hi Khampol,
yes for lookup tables you don't need any relationship. The lookup table just gives you some values to select into a field.
In case of Gender I would prefer the Option "list of values" and the fill in "male" "female".

So you don't need a seperate lookup table for this.
If you want to be politically correct an have many genders ( like here : https://ageofshitlords.com/list-of-all-tumblr-genders-so-far/ )

Or e.g. you have a list of departments ....a lookup could make sense.
CU

Andreas


Thanks for your suggestion Andreas <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=80882&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />.