943,691 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 783
  • MySQL RSS
Feb 13th, 2009
0

Help with database design?

Expand Post »
Hi folks,

I’m planning on building a site somewhat similar to a web hosting directory and was hoping to get some input/advice on the database design from all you coding gurus

I’d like to have two different types of users: 1) hosts 2) normal users

Because of the this, I’ll need two seperate registration forms (with different fields). Will I require two tables in the db or can I combine them into one? I would also like to allow the host admin to be able to add/edit/delete users associated to that host.

What would be the best way to go about creating the database?

Thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
KeithMcL is offline Offline
34 posts
since Oct 2004
Feb 13th, 2009
0

Re: Help with database design?

It depends on how you want to pull the data if you want hosts items to see users items the put it all in one table if users and hosts will never see the same data then put in 2 different tables.
Reputation Points: 12
Solved Threads: 36
Posting Pro in Training
freshfitz is offline Offline
436 posts
since Sep 2008
Feb 16th, 2009
1

Re: Help with database design?

This depends on your relational design. As you mention information about your project, the hosts are "service providers" and the users are "service consumers/takers". You need to decide whether what relationship the hosts and users share. If a user can have content hosted on multiple hosts then there is clearly a many-to-many relationship between them, as hosts certainly can have multiple users.
Once you have decided this, you need take into consideration what attributes/information you would like to store for the hosts and the users. Each of these attributes would be fields/column in the tables. From what I understand, I don't think that hosts and users would share more than a few attributes and hence it is advisable to use two different tables for them.

>I would also like to allow the host admin to be able to add/edit/delete users associated to that host.

This is concept that you would have to implement in your coding.
Reputation Points: 485
Solved Threads: 89
Posting Shark
verruckt24 is offline Offline
944 posts
since Nov 2008
Feb 16th, 2009
0

Re: Help with database design?

I've only learned one thing about DB design

store date and time as timestamps its a lot faster to compare numeric timestamps than text date/time stings
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Feb 17th, 2009
0

Re: Help with database design?

Thanks for the replies everyone. I've still not worked it out as I'm reconsidering how I want the site to work.
Reputation Points: 10
Solved Threads: 0
Light Poster
KeithMcL is offline Offline
34 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: MySQL 1067 error, cant connect to database
Next Thread in MySQL Forum Timeline: Performance Issue Using Full Text Search





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC