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 :P

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 :)

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.

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.

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

Thanks for the replies everyone. I've still not worked it out as I'm reconsidering how I want the site to work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.