My project use EAV modeling
My table and output are as follows ,
INPUT TABLES
[1] customer_entry
----------------------------
cust_entity_id | email
----------------------------
1 |
bidi@addon.com
2 |
rav@addon.com
----------------------------
[2] eav_attribute_type
------------------------------------------
attribute_type_id | name
------------------------------------------
1 | customer
2 | customer_address
------------------------------------------
[3] eav_attribute
-----------------------------------------------------------
attribute_id | code | attribute_type_id
-----------------------------------------------------------
1 | speciality | 1
2 | small_image | 1
3 | city | 2
-----------------------------------------------------------
(Note :- eav_attribute.attribute_type_id refrence eav_attribute_type.attribute_type_id)
[4] customer_address_entry
---------------------------------------------------------------
add_entity_id |attribute_type_id | cust_entity_id
---------------------------------------------------------------
1 | 2 | 1
---------------------------------------------------------------
(Note :- customer_address_entry.attribute_type_id reference eav_attribute_type.attribute_type_id and
customer_address_entry.cust_entity_id reference customer_entry.cust_entity_id
)
[5] customer_address_entry_varchar
------------------------------------------------------------------------
v_id | attribute_type_id | attribute_id | add_entity_id | value
------------------------------------------------------------------------
1 | 2 | 3 | 1 | Ahmedabad
------------------------------------------------------------------------
(Note :- customer_address_entry_varchar.entity_id reference customer_address_entry.address_entity_id
customer_address_entry_varchar.attribute_type_id reference eav_attribute_type.attribute_type_id and
customer_address_entry_varchar.attribute_id reference eav_attribute.attribute_id
[6] customer_entry_varchar
------------------------------------------------------------------------------------------------------------------------
v_id | attribute_type_id | attribute_id | entity_id | value
------------------------------------------------------------------------------------------------------------------------
1 | 1 | 1 | 1 | painting
2 | 1 | 2 | 1 | myimage.gif
------------------------------------------------------------------------------------------------------------------------
(Note :- customer_entry_varchar.entity_id reference customer_entry.cust_entity_id
customer_entry_varchar.attribute_type_id reference eav_attribute_type.attribute_type_id and
customer_entry_varchar.attribute_id reference eav_attribute.attribute_id
And Out i need sir
OUT PUT
---------
------------------------------------------------------------------------
cust_entity_id | city | speciality | small_image
------------------------------------------------------------------------
1 | Ahmedabad | painting | myimage.gif
------------------------------------------------------------------------
Edited 1 time(s). Last edit at 11/27/2009 06:34PM by Harshad Goswami.