frikus Posted December 7, 2007 Share Posted December 7, 2007 What is the best way to store product features similar to those in the screen-shot? A user must be able to search for products by these features too: Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/ Share on other sites More sharing options...
fenway Posted December 7, 2007 Share Posted December 7, 2007 This is a classical name/value pair example -- I assume the categories and subcategories are "real" -- i.e. have UIDs to records in tables somewhere. Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/#findComment-409019 Share on other sites More sharing options...
frikus Posted December 7, 2007 Author Share Posted December 7, 2007 ??? fenway, can you give me more details on this classical example ? Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/#findComment-409112 Share on other sites More sharing options...
fenway Posted December 7, 2007 Share Posted December 7, 2007 Where are these values coming from? Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/#findComment-409133 Share on other sites More sharing options...
frikus Posted December 7, 2007 Author Share Posted December 7, 2007 These values are coming from a user posting an online car ad. On 'Build Your Ad' page users can check all the corresponding checkboxes, so the list of available features will show up in the ad. Something like this: 'Features: Air Conditioning, Driver Side Air Bag, Passenger Side Air Bag, Anti-Lock Brakes, AM/FM Radio, Security Features, Alloy Wheels, All Wheel Drive, Bucket Seats, Center Arm..' Other users can do advanced search for cars by these features - they select Make, Model, Year and check the checkboxes with the features they want. I assume that i need a separate row for each car feature in the main 'car_ads' table. The simplified version of this table can look like this: idmakemodelyearair_bagspower_windowscd_changer 12307DodgeNeon20031 0 0 12407BmwX520041 1 1 12507DaewooLanos20010 0 0 But by building the table this way I will end up with too many rows, because there are so many features in modern cars. Is there a better way to accomplish this or having many rows in a table is ok? Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/#findComment-409193 Share on other sites More sharing options...
fenway Posted December 9, 2007 Share Posted December 9, 2007 So they're not currently represented in the db? Link to comment https://forums.phpfreaks.com/topic/80650-checkboxes-and-mysql/#findComment-410364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.