$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attributeCode);
$id = $attribute->getId();
場合$idでnull、属性は存在しません。
カテゴリ属性、顧客属性、および顧客住所属性を取得する場合も同様に機能します。
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_category', 'is_anchor');
$attribute = Mage::getModel('eav/config')->getAttribute('customer', 'gender');
$attribute = Mage::getModel('eav/config')->getAttribute('customer_address', 'postcode');
[編集]
 
どうやら私は読むことができません。私は述べた行を逃しましたsql query。
これもクエリです:
SELECT 
    e.attribute_id 
FROM 
    eav_attribute e
LEFT JOIN
    eav_entity_type t 
ON e.entity_type_id = t.entity_type_id
WHERE 
    e.attribute_code = 'image' AND
    t.entity_type_code = 'catalog_product'
               
              
SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'image' AND frontend_input = 'media_image'、しかし私はeav_attribute表を見る必要があることを示してくれてありがとう。:)