Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 11th, 2009, 03:35 AM
Authorized User
 
Join Date: Aug 2009
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default Separate user tables?

Hello!
Please excuse me if this is a stupid question, but I just have a quick one...

If you have a site where users can register with 2 options, free registration and a pay registration where you would get more features, is it better to create 2 tables for the 2 different types of users? Or does that just slow down searches etc if you want to be able to search through all the users at once?

Could somebody please advise me on the best way to go about this?

Thank you in advance. I do appreciate the advice
Reply With Quote
  #2 (permalink)  
Old December 14th, 2009, 08:40 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Have you ever done programming in your life before?

Have you ever done database structuring?

If the answer is yes to both of those then merely you get some relational tables on the go with keys and foreign keys.

If the answer is no, then i heartly suggest you go and read up on both of those, take a trip down the library with good ole pen and paper and do some research!

Happy coding!
__________________
Apocolypse2005, I'm a programmer - of sorts.
Reply With Quote
  #3 (permalink)  
Old May 5th, 2010, 11:49 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Quote:
Originally Posted by Clint View Post
Hello!
Please excuse me if this is a stupid question, but I just have a quick one...

If you have a site where users can register with 2 options, free registration and a pay registration where you would get more features, is it better to create 2 tables for the 2 different types of users? Or does that just slow down searches etc if you want to be able to search through all the users at once?

Could somebody please advise me on the best way to go about this?

Thank you in advance. I do appreciate the advice
In a situation like this, I would say it's clearly best to create both types of users in one database table. Paying vs. free clients will simply be the two roles you have to start with. Create a roles table with an entry for Free user and a second entry for paying user. The most scalable way to connect the two is to create another database table with two fields, one for role ids and one for user ids. In this way you can create records which match a user to a role, and users can have multiple roles (even though at this point your application won't need to do that).
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Reply With Quote
  #4 (permalink)  
Old May 11th, 2012, 06:06 AM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or you could just add a column in your "user" table which has 2 different values for paying and non-paying users (say, 1 and 2 ). What about that ?

Mike
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Indexing tables in user defined functions A17560127 SQL Server 2005 1 July 21st, 2008 03:56 AM
Two separate menu from one sitemap? KieshaJ310 ASP.NET 2.0 Basics 5 July 4th, 2007 01:31 AM
User Control on Separate Line jason.pileski@pacourts.us ASP.NET 2.0 Professional 1 August 9th, 2006 11:44 AM
Select to all user tables in db Moueg SQL Server 2000 5 December 13th, 2004 09:56 AM
How do we differentiate b/w User and Sys tables softwarearchitect SQL Server 2000 5 May 30th, 2004 08:39 AM



All times are GMT -4. The time now is 02:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.