[eluser]Seller[/eluser]
[quote author="adityamenon" date="1307604429"]That's pretty deep. I understood your problem, but can you post a diagram of your MySQL schema here? That would help me understand your solution better; and suggest any improvements if necessary.[/quote]
The scheme of my tables. Graphic diagram in the attachment
Code:
table `fields`
+-------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(128) | NO | | | |
| type | varchar(128) | NO | | | |
+-------+------------------+------+-----+---------+----------------+
table `fields_values`
+---------+------------------+------+-----+---------+--------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+--------------+
| id | int(11) | NO | PRI | NULL | |
| good_id | int(11) | NO | | | |
| value | varchar(128) | NO | | | |
+---------+------------------+------+-----+---------+--------------+
table `fields_groups`
+-------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(128) | NO | | | |
+-------+------------------+------+-----+---------+----------------+
table `fields_in_group`
+----------+-------------+----------------+-----------+---------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+--------+-------+-----------+---------------+
| group_id | int(11) | NO | PRI | | |
| field_id | int(128) | NO | | | |
+----------+-------------+---------+------+-----------+---------------+
table `menu`
+---------+------------------+------+-----+---------+--------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+--------------+
| id | int(11) | NO | PRI | NULL |auto_increment|
| name | varchar(255) | NO | | | |
| par | int(11) | NO | | | |
+---------+------------------+------+-----+---------+--------------+