Jump to content

Recommended Posts

i have a database that im using for my site first i have my table "users" that stores all of my data for the user on my site username password ect. then each user has a table that is used to store the information about all of there uploaded files but now i need a way to save messages to a database how can i do this

 

should i use a type collum in the user's table so i can put type=message type=photo in the same table or will this slow it down to much

Link to comment
https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/
Share on other sites

Read about data normalization: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html

 

Basically you will separate the data types and likely use the 1 (user) to many (messages), and 1(user) to many (photos) type relationships for your new tables.

 

Please read and try to understand the article, it will save you many future headaches.

then each user has a table that is used to store the information about all of there uploaded files but now i need a way to save messages to a database how can i do this

 

Do you really have a seperate table for each users details? That is very unnecessary and not a nice way of doing it.

 

All the best

 

Keith

Hi

 

Conventionally you would have a table of users, and then a related table containing certain info for ALL  those users.

 

Eg, a table of users and a seperate table of address lines, with the user id from the first table being a indexed column on the 2nd table.

 

All the best

 

Keith

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.