Help with database design?

Reply

Join Date: Oct 2004
Posts: 34
Reputation: KeithMcL is an unknown quantity at this point 
Solved Threads: 0
KeithMcL's Avatar
KeithMcL KeithMcL is offline Offline
Light Poster

Help with database design?

 
0
  #1
Feb 13th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 339
Reputation: freshfitz is an unknown quantity at this point 
Solved Threads: 27
freshfitz freshfitz is offline Offline
Posting Whiz

Re: Help with database design?

 
0
  #2
Feb 13th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Help with database design?

 
1
  #3
Feb 16th, 2009
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.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,342
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Help with database design?

 
0
  #4
Feb 16th, 2009
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
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 34
Reputation: KeithMcL is an unknown quantity at this point 
Solved Threads: 0
KeithMcL's Avatar
KeithMcL KeithMcL is offline Offline
Light Poster

Re: Help with database design?

 
0
  #5
Feb 17th, 2009
Thanks for the replies everyone. I've still not worked it out as I'm reconsidering how I want the site to work.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC