FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


What do they call this type of table





jmraker
Say I have 3 tables: user, website and user_website

Where user_website has 3 fields
id (primary autoincrementing key)
user (foreign key to user.id)
website (foreign key to website.id)

What is this correct name of this table that joins/merges the user and website tables together?
Is it a Join table, Merge table, Foreign key table, or something else.

I want to name the function that updates these types of tables correctly.
kacsababa
I guess it is a many-to-many relationship, although you usually don't really need an id field in that table. Just make both user and website primary key, multiple instance of the same pairing is just redundancy anyway. I think it called associative, reference (xref) table or link table, etc.
Fire Boar
It's called a link table. You don't need an autoincrementing id field though, just have a composite primary key made up of user and website. Unless you need more than one join per user/website pair.
Related topics
HTTP AUTH with PHP and mySQL
[Beginner] css rollovers
Site Nav Suggestions...
Login Scripts
X Arcade Version 1.0
PHP Tutorial: Basic Shoutbox w/ MySQL
Shoutbox?
myBBoard - Installation Tutorial
Creating a poll
Computer Problems
PHP VS ASP
need a script.
Something weird happened...
What does the + symbol before new keyword does (tuts)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.