Jump to content

Membership area logic question


Grant Holmes

Recommended Posts

Hey gang. A little discussion here. I need to create a membership area. I found a script here from http://phpsnips.com/snippet.php?id=16 That would allow creation of a basic user.

 

We're going to collect other basic demographic information, including a couple photos. I assume I should only use one database. Should I have this initial user file setup information (above) ONLY in one table and all the other information (call this demographic stuff) in another table? Should the photo images (ONLY) be in a totally separate table, or should the images be in with the demographic stuff?

 

I know little about PHP and nothing about "Joining" tables, but I'm learning.

 

Please give me guidance on how best to proceed.

Link to comment
Share on other sites

the question of if I need a new table for some data comes down to answering the question

 

"Can I have all this data stored in rows that are linked by a single key"

 

If the answer is no make tables to satisify it

 

If its yes you are good

 

In your case the answer is no because the photos need to be many photos to 1 row, and mysql doesn't expand that way naturally (adding additional fields)

Link to comment
Share on other sites

You'll actually want to look into "relational database tables".  There are several good articles on the web about them.  As a previous reply mentioned, the a great way to think about it is "does all this information fit easily on one row".  You might also want to ask yourself "is this information likely to be duplicated over and over again within my rows".  If so...and dependent on the complexity of the information...you'll also want to build a separate table for that information.

 

If you take some time to build your database tables correctly, you will save a myriad of headaches down the road.

Link to comment
Share on other sites

Thanks all for the great informative replies.

 

In this case, we'd be limiting users to five image, not unlimited.

And for the most part, I FEEL like it could be in one row, one for each user.

 

Is there "more security" in having 'user' information separate from 'demographic' information? I would think this would be moot, but am unsure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.