MikeDXUNL Posted June 29, 2009 Share Posted June 29, 2009 Alrighty, Say I have a site where there are these fields in the db. TABLE: photo_package FIELDS: product_id, gallery_id, title, productfam I need to, on a page, give every product in the family to display. So say I have. DATA: 1, 4, mac book, 4 2, 4, laptop, 4 3, 3, some book, 4,3 The last one has a productfam of 4 and 3 cause when on the 'Some Book' page, it should show Mac Book and Laptop as part of it's product family. What would be the best way to approach getting these values? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/164052-arrays-and-such-need-help/ Share on other sites More sharing options...
Ken2k7 Posted June 29, 2009 Share Posted June 29, 2009 Store them as separate entities. Like such - DATA: 1, 4, mac book, 4 2, 4, laptop, 4 3, 3, some book, 4 3, 3, somoe book, 3 Link to comment https://forums.phpfreaks.com/topic/164052-arrays-and-such-need-help/#findComment-865420 Share on other sites More sharing options...
MikeDXUNL Posted June 29, 2009 Author Share Posted June 29, 2009 I have 200 products right now, and that would kind of be a waste of data wouldn't it?... That doesn't seem efficient at all. Link to comment https://forums.phpfreaks.com/topic/164052-arrays-and-such-need-help/#findComment-865423 Share on other sites More sharing options...
MikeDXUNL Posted June 29, 2009 Author Share Posted June 29, 2009 BUMP. Link to comment https://forums.phpfreaks.com/topic/164052-arrays-and-such-need-help/#findComment-865669 Share on other sites More sharing options...
MatthewJ Posted June 29, 2009 Share Posted June 29, 2009 It is never a good idea to store multiple values in a single field... Which should be evident since you're having a problem getting the data out right. Not to mention 200 products is a very small set of data. Link to comment https://forums.phpfreaks.com/topic/164052-arrays-and-such-need-help/#findComment-865674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.