Guys, I need to create a sql database field to hold some lists.mmm actually I need to store list of features of products.I have around 1000 products.I don't know a way to store a data as a list on MySql and to retrieve it as a list. If you know a way please give me at least a hint about storing type for a list and the way to retrieving it to an array. eg.. product one - red color - metal made product two - black color - Plastic made - Waterproof - Dust proof etc.. Waiting for a response. Thank you.
For your all datas you can use varchar data type without any problem but things is how do you organize your fields
Databases should very rarely hold lists. Your table structure should include 2 tables--Products and Attributes--and look something like this: Products: ProductID ProductName 1 'product one' 2 'product two' Attributes: ProductID ProductAttribute 1 'red color' 1 'metal made' 2 'black color' 2 'Plastic made' 2 'Waterproof' 2 'Dust proof' Each product gets a unique ID in the Products table that is then used to reference it in the Attributes table. Then you can use a query to pull all the attributes of a particular product.