Answer the question
In order to leave comments, you need to log in
How to properly store this data or how to process it correctly when requested?
There is a need to store a product specification, a kind of belonging to a particular group of products in the database. When requesting a specific page, they should show only records that have the type that was requested in the "specification" (for example, by filter). What I came up with at the moment:
for n-products, in the database, in the specification column, such an entry is "phone fablet 2core etc". The page requests products related to the "phone" specification. Request
SELECT * FROM table WHERE specification LIKE '%phone%'
Answer the question
In order to leave comments, you need to log in
Create a separate table where your filters will be stored and a link table between products and filters. In this case, it will be easy to select similar products.
product <-> product_to_specification <-> specification
If necessary, it will be possible to classify features of specifications, show products that have the same specifications or are the most similar in terms of parameters.
If full-text search is required, then immediately look towards sphinx.
LIKE '%phone%'
so the query will be executed for a long time..
it is
necessary (
LIKE ='phone'
'phone%' (in extreme cases...)) prop_id), a list of tree post types link: (id, type: category, good, property, etc..), a list of prop values: (id,title,parent_id,param1,....paramN) and a link table (id, goods_id, prop_id).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question