DanDaBeginner Posted February 21, 2007 Share Posted February 21, 2007 ------------------------------------ table: friend ------------------------------------ fields: friend_rid = autoincrement --- request_fr = user_id of the sender of request --- request_to = user_id of the recepient of request --- statusr= if 0 the request is pending, if 1 then approve by request to. ------------------------------------ now once the request_to approve the request, it will automatically listed to Friend's list of 'request_fr' and request_to.. I need some advise if my table structure is right or not, or maybe I can add new table which after the 'request_to' approve the request it will be added to 'new_table' with the field 'new_field1' and 'new_field2' for example 1 has approve the request of 2 then it will added to 'new_table' with this output: ----------------------- new_field1 | new_field2 1 | 2 2 | 1 ---------------------- and it will be deleted to friend table.. need some advise, I post this one 3x but I still got no response.. any help is greatly appreciated.. thanx in advance. Link to comment https://forums.phpfreaks.com/topic/39470-solved-need-advise-with-table-decision/ Share on other sites More sharing options...
ted_chou12 Posted February 21, 2007 Share Posted February 21, 2007 yes, the overall structure is fine, for me, I had three types of requests actions, one is add, one is delete, and one is pending. When user A adds user B, user A's status should be pending, and you leave user B's request out first, after user B had accepted, then insert another row for user B. So there will be two rows for this connection. When user B deletes user A, user B's row should be deleted, however, user A's row's status should be declined. I think thats how I did it, in that way, you can have a two way friends network. Ted Link to comment https://forums.phpfreaks.com/topic/39470-solved-need-advise-with-table-decision/#findComment-190426 Share on other sites More sharing options...
DanDaBeginner Posted February 21, 2007 Author Share Posted February 21, 2007 thax for the reply ted you gave me a very good idea...so for you, no need to add new table just stick to friend table and make 2 row for 1 friend connection.. just like this? when A send a request to B and approve.this will be the result request_fr | request to | statusr A B 1 B A 1 -------------------------- i really want to make this one loud and clear... thanx again.... Link to comment https://forums.phpfreaks.com/topic/39470-solved-need-advise-with-table-decision/#findComment-190438 Share on other sites More sharing options...
ted_chou12 Posted February 21, 2007 Share Posted February 21, 2007 yeah, thats it. Link to comment https://forums.phpfreaks.com/topic/39470-solved-need-advise-with-table-decision/#findComment-190440 Share on other sites More sharing options...
DanDaBeginner Posted February 21, 2007 Author Share Posted February 21, 2007 thanx again ted.. Link to comment https://forums.phpfreaks.com/topic/39470-solved-need-advise-with-table-decision/#findComment-190456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.