The basis for filtering data withdrawal from MySQL



  • Respectful knowledge!

    An expanded filtering of data withdrawal from MySQL is needed. I wonder where to start what needs to be known and how to be properly developed so that other filtering parameters can be added without problems and therefore not download the database.

    The picture I attached below shows the type of filtering I want to do.

    Please tell me if there are any special framings or explain the PHP algorithm to develop data filtering.

    Thank you!

    введите сюда описание изображения



  • First, the data storage system needs to be defined.

    You need the following tables:

    1. (property) - it contains filtering categories (id, property_name)
    2. Values (property_value) - the table contains values of properties (id, value, property_id)
    3. Table for goods - the table stores goods linked to table property_2_product
    4. Table property_2_product - The table retains the linkage of properties to goods (id, product_id, property_value_id)

    To build a filter, you need to select the values from the first two tables. In order to achieve the results, you need to select data from 3 and 4 of the filtering table.

    Algorithm PHP is simple.

    To remove the filter:

    1. Choose filter categories and filtering values
    2. We' cycle data

    For the filtering of goods:

    1. The filter is a HTML form - the results are in PHP.
    2. PHP receives filtering parameters.
    3. Selection of goods according to parameters from the table of goods



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2