Created
February 21, 2013 15:35
-
-
Save mschultheiss83/5005521 to your computer and use it in GitHub Desktop.
Get product eav entries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use your_databasse; | |
set @attribute_code = 'name'; | |
set @entity_type_id = '4'; | |
set @entity_id = '502'; | |
set @backend_type = | |
(select backend_type | |
from eav_attribute | |
where attribute_code = @attribute_code and | |
entity_type_id = @entity_type_id); | |
set @attribute_id = | |
(select attribute_id | |
from eav_attribute | |
where attribute_code = @attribute_code and | |
entity_type_id = @entity_type_id); | |
set @select_attribute := | |
CONCAT( | |
'SELECT * FROM ', | |
CONCAT('catalog_product_entity', '_', @backend_type), ' ', | |
CONCAT('WHERE attribute_id = ', @attribute_id, ' AND ' , | |
'entity_id = ', @entity_id) | |
); | |
select @select_attribute; | |
Prepare stmt FROM @select_attribute; | |
Execute stmt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment