Welcome Guest, Not a member yet? Register   Sign In
MySQL database structure - one-to-many-many
#4

[eluser]srisa[/eluser]
How about this approach
Code:
tbl_users
--------------
id - int auto_increment primary key
username

tbl_business
-------------
id - int auto_increment primary key
businessname

tbl_type
-------------------------------
id - int auto_increment primary key
typename
(Sample data: 1-users, 2-business) unique

tbl_phone
----------------------------------------------
type - references tbl_type(id)
id   - (references tbl_users(id) or tbl_business(id))
phone - phone number
primary(type, id, phone)


Messages In This Thread
MySQL database structure - one-to-many-many - by El Forum - 04-20-2009, 05:38 PM
MySQL database structure - one-to-many-many - by El Forum - 04-20-2009, 06:21 PM
MySQL database structure - one-to-many-many - by El Forum - 04-21-2009, 02:31 AM
MySQL database structure - one-to-many-many - by El Forum - 04-21-2009, 03:32 AM
MySQL database structure - one-to-many-many - by El Forum - 04-21-2009, 03:40 AM
MySQL database structure - one-to-many-many - by El Forum - 04-21-2009, 08:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB