aliento Posted October 10, 2009 Share Posted October 10, 2009 Hi, I need to have pm at my php application , the pms will be a lot between the members. I dont know how to build the db ? One table for all pms Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/ Share on other sites More sharing options...
aliento Posted October 10, 2009 Author Share Posted October 10, 2009 what makes me trouble is the number of the pms which will be a lot. So the db will need a lot of time to pick the correct pm message. Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/#findComment-934230 Share on other sites More sharing options...
Daniel0 Posted October 10, 2009 Share Posted October 10, 2009 Well, a simple way of doing it would be a table structure like this: pm_id recipient_id (references users table) sender_id (references users table) subject body sent_at (DATETIME) That should work find with indexes on recipient_id and sender_id. Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/#findComment-934240 Share on other sites More sharing options...
aliento Posted October 10, 2009 Author Share Posted October 10, 2009 Yes it will be like this but the entries at this table will be a lotttt. Is this a problem? Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/#findComment-934255 Share on other sites More sharing options...
Daniel0 Posted October 10, 2009 Share Posted October 10, 2009 Databases are build to handle a lot of data. They handle handle more than you probably think they can. The indexes are the key here because that's what makes it unnecessary to search linearly through the entire table. Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/#findComment-934258 Share on other sites More sharing options...
aliento Posted October 10, 2009 Author Share Posted October 10, 2009 nice. thank you Quote Link to comment https://forums.phpfreaks.com/topic/177179-solved-pm-db-structure/#findComment-934259 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.