paulsteigel
Member
Hi All,
I have a case (I dont know about PHP) that is unsolvable by myself and would like to ask you all for help.
Case: I have two table that named:
+ Products (ID, product_name...)to keep listing of agricultural products;
+ Product_profile (ID, Product_ID, Parent_ID, Attribute, Description) for storing varying data relating to a product.
Requirements:
+ When adding a profile for a product,
(1) Choose product with a databasejoin dropdown
(2) Choose a parent item from product_profile: for example item 1 - General instruction, I add a new item 1.1 for back ground data (like heading level in Word heading 1, 2, 3...) that takes General instruction as the parent item.
So I would like the dropdown for parent item will only list existing Attributes for the product_id selected from step 1.
In the Data where, joins where and/or order by statement (SQL) field I added
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id}
And applied for both (add new and edit)
This failed.
In the case of Edit, I would also expect that the Parent_id dropdown will not list attribute of the current editing record itself with
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id} AND {thistable}.id <> {products_profile___id}
and it works in editing only.
Could you all be so kind helping me in dealing with this.
Thank you very much for your attention!
Yours very faithfully
Dang Dinh ngoc - From Vietnam
I have a case (I dont know about PHP) that is unsolvable by myself and would like to ask you all for help.
Case: I have two table that named:
+ Products (ID, product_name...)to keep listing of agricultural products;
+ Product_profile (ID, Product_ID, Parent_ID, Attribute, Description) for storing varying data relating to a product.
Requirements:
+ When adding a profile for a product,
(1) Choose product with a databasejoin dropdown
(2) Choose a parent item from product_profile: for example item 1 - General instruction, I add a new item 1.1 for back ground data (like heading level in Word heading 1, 2, 3...) that takes General instruction as the parent item.
So I would like the dropdown for parent item will only list existing Attributes for the product_id selected from step 1.
In the Data where, joins where and/or order by statement (SQL) field I added
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id}
And applied for both (add new and edit)
This failed.
In the case of Edit, I would also expect that the Parent_id dropdown will not list attribute of the current editing record itself with
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id} AND {thistable}.id <> {products_profile___id}
and it works in editing only.
Could you all be so kind helping me in dealing with this.
Thank you very much for your attention!
Yours very faithfully
Dang Dinh ngoc - From Vietnam