ldb358 Posted June 23, 2009 Share Posted June 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/ Share on other sites More sharing options...
xtopolis Posted June 24, 2009 Share Posted June 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862433 Share on other sites More sharing options...
kickstart Posted June 24, 2009 Share Posted June 24, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862528 Share on other sites More sharing options...
ldb358 Posted June 24, 2009 Author Share Posted June 24, 2009 what do you mean? what i have is a users table with all of the users information then each user has a table in order to store the the source, size artist, ect. for all of the users uploaded art Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862671 Share on other sites More sharing options...
ldb358 Posted June 24, 2009 Author Share Posted June 24, 2009 thanks for the article don't know if i get it all the way but im working on it thanks Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862693 Share on other sites More sharing options...
ldb358 Posted June 24, 2009 Author Share Posted June 24, 2009 Okay thanks for the article it help alot Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862703 Share on other sites More sharing options...
kickstart Posted June 24, 2009 Share Posted June 24, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/163420-solved-help-restructuring-my-database/#findComment-862739 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.